IP分组部分逻辑提交
This commit is contained in:
315
src/main/java/com/nis/domain/basics/IpCommCfg.java
Normal file
315
src/main/java/com/nis/domain/basics/IpCommCfg.java
Normal file
@@ -0,0 +1,315 @@
|
||||
package com.nis.domain.basics;
|
||||
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class IpCommCfg extends BaseCfg<IpCommCfg> {
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 4218856118489784060L;
|
||||
|
||||
/**
|
||||
* 创建一个新的实例 BaseIpCfg.
|
||||
*
|
||||
*/
|
||||
public IpCommCfg() {
|
||||
super();
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
private String indexTable="ip_comm_cfg";
|
||||
/**
|
||||
* ip类型
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("ipType")
|
||||
@ExcelField(title="ip_type",dictType="IP_TYPE",sort=50)
|
||||
protected Integer ipType;
|
||||
@ExcelField(title="src_ip_pattern",dictType="IP_PATTERN",sort=51)
|
||||
protected Integer srcIpPattern;
|
||||
@ExcelField(title="client_ip",sort=52)
|
||||
protected String srcIpAddress;
|
||||
@ExcelField(title="dest_ip_pattern",dictType="IP_PATTERN",sort=53)
|
||||
protected Integer destIpPattern;
|
||||
@ExcelField(title="server_ip",sort=54)
|
||||
protected String destIpAddress;
|
||||
@ExcelField(title="src_port_pattern",dictType="PORT_PATTERN",sort=54)
|
||||
protected Integer srcPortPattern;
|
||||
@ExcelField(title="dest_port_pattern",dictType="PORT_PATTERN",sort=54)
|
||||
protected Integer destPortPattern;
|
||||
@ExcelField(title="client_port",sort=55)
|
||||
protected String srcPort;
|
||||
@ExcelField(title="server_port",sort=56)
|
||||
protected String destPort;
|
||||
protected Integer dnsStrategyId;
|
||||
@ExcelField(title="ir_type",dictType="IR_TYPE",sort=57)
|
||||
protected Integer irType;
|
||||
@ExcelField(title="group_name",sort=58)
|
||||
protected String groupName;
|
||||
// @ExcelField(title="log_total",sort=42)
|
||||
private Long totalLogs;
|
||||
private Integer regionId;
|
||||
private Integer groupId;
|
||||
|
||||
public Integer getRegionId() {
|
||||
return regionId;
|
||||
}
|
||||
public void setRegionId(Integer regionId) {
|
||||
this.regionId = regionId;
|
||||
}
|
||||
public Integer getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
public void setGroupId(Integer groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
public Long getTotalLogs() {
|
||||
return totalLogs;
|
||||
}
|
||||
public void setTotalLogs(Long totalLogs) {
|
||||
this.totalLogs = totalLogs;
|
||||
}
|
||||
/**
|
||||
* irType
|
||||
* @return irType
|
||||
*/
|
||||
|
||||
public Integer getIrType() {
|
||||
return irType;
|
||||
}
|
||||
/**
|
||||
* @param irType the irType to set
|
||||
*/
|
||||
public void setIrType(Integer irType) {
|
||||
this.irType = irType;
|
||||
}
|
||||
/**
|
||||
* groupName
|
||||
* @return groupName
|
||||
*/
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
/**
|
||||
* @param groupName the groupName to set
|
||||
*/
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
/**
|
||||
* 方向
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("direction")
|
||||
@ExcelField(title="direction",dictType="DIRECTION",sort=58)
|
||||
protected Integer direction ;
|
||||
/**
|
||||
* 协议
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("protocol")
|
||||
@ExcelField(title="protocol",dictType="PROTOCOL",sort=59)
|
||||
protected Integer protocol ;
|
||||
/**
|
||||
* 协议ID
|
||||
*/
|
||||
@Expose
|
||||
@SerializedName("protocolId")
|
||||
protected Integer protocolId ;
|
||||
/**
|
||||
* 限速比例
|
||||
*/
|
||||
protected String ratelimit ;
|
||||
|
||||
/**
|
||||
* ratelimit
|
||||
* @return ratelimit
|
||||
*/
|
||||
|
||||
public String getRatelimit() {
|
||||
return ratelimit;
|
||||
}
|
||||
/**
|
||||
* @param ratelimit the ratelimit to set
|
||||
*/
|
||||
public void setRatelimit(String ratelimit) {
|
||||
this.ratelimit = ratelimit;
|
||||
}
|
||||
/**
|
||||
* ipType
|
||||
* @return ipType
|
||||
*/
|
||||
|
||||
public Integer getIpType() {
|
||||
return ipType;
|
||||
}
|
||||
/**
|
||||
* @param ipType the ipType to set
|
||||
*/
|
||||
public void setIpType(Integer ipType) {
|
||||
this.ipType = ipType;
|
||||
}
|
||||
|
||||
/**
|
||||
* direction
|
||||
* @return direction
|
||||
*/
|
||||
|
||||
public Integer getDirection() {
|
||||
return direction;
|
||||
}
|
||||
/**
|
||||
* @param direction the direction to set
|
||||
*/
|
||||
public void setDirection(Integer direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
/**
|
||||
* protocol
|
||||
* @return protocol
|
||||
*/
|
||||
|
||||
public Integer getProtocol() {
|
||||
return protocol;
|
||||
}
|
||||
/**
|
||||
* @param protocol the protocol to set
|
||||
*/
|
||||
public void setProtocol(Integer protocol) {
|
||||
this.protocol = protocol;
|
||||
}
|
||||
/**
|
||||
* protocolId
|
||||
* @return protocolId
|
||||
*/
|
||||
|
||||
public Integer getProtocolId() {
|
||||
return protocolId;
|
||||
}
|
||||
/**
|
||||
* @param protocolId the protocolId to set
|
||||
*/
|
||||
public void setProtocolId(Integer protocolId) {
|
||||
this.protocolId = protocolId;
|
||||
}
|
||||
|
||||
|
||||
public Integer getSrcIpPattern() {
|
||||
return srcIpPattern;
|
||||
}
|
||||
public void setSrcIpPattern(Integer srcIpPattern) {
|
||||
this.srcIpPattern = srcIpPattern;
|
||||
}
|
||||
public Integer getDestIpPattern() {
|
||||
return destIpPattern;
|
||||
}
|
||||
public void setDestIpPattern(Integer destIpPattern) {
|
||||
this.destIpPattern = destIpPattern;
|
||||
}
|
||||
public Integer getSrcPortPattern() {
|
||||
return srcPortPattern;
|
||||
}
|
||||
public void setSrcPortPattern(Integer srcPortPattern) {
|
||||
this.srcPortPattern = srcPortPattern;
|
||||
}
|
||||
public Integer getDestPortPattern() {
|
||||
return destPortPattern;
|
||||
}
|
||||
public void setDestPortPattern(Integer destPortPattern) {
|
||||
this.destPortPattern = destPortPattern;
|
||||
}
|
||||
/**
|
||||
* srcIpAddress
|
||||
* @return srcIpAddress
|
||||
*/
|
||||
|
||||
public String getSrcIpAddress() {
|
||||
return srcIpAddress;
|
||||
}
|
||||
/**
|
||||
* @param srcIpAddress the srcIpAddress to set
|
||||
*/
|
||||
public void setSrcIpAddress(String srcIpAddress) {
|
||||
this.srcIpAddress = srcIpAddress;
|
||||
}
|
||||
/**
|
||||
* destIpAddress
|
||||
* @return destIpAddress
|
||||
*/
|
||||
|
||||
public String getDestIpAddress() {
|
||||
return destIpAddress;
|
||||
}
|
||||
/**
|
||||
* @param destIpAddress the destIpAddress to set
|
||||
*/
|
||||
public void setDestIpAddress(String destIpAddress) {
|
||||
this.destIpAddress = destIpAddress;
|
||||
}
|
||||
/**
|
||||
* srcPort
|
||||
* @return srcPort
|
||||
*/
|
||||
|
||||
public String getSrcPort() {
|
||||
return srcPort;
|
||||
}
|
||||
/**
|
||||
* @param srcPort the srcPort to set
|
||||
*/
|
||||
public void setSrcPort(String srcPort) {
|
||||
this.srcPort = srcPort;
|
||||
}
|
||||
/**
|
||||
* destPort
|
||||
* @return destPort
|
||||
*/
|
||||
|
||||
public String getDestPort() {
|
||||
return destPort;
|
||||
}
|
||||
/**
|
||||
* @param destPort the destPort to set
|
||||
*/
|
||||
public void setDestPort(String destPort) {
|
||||
this.destPort = destPort;
|
||||
}
|
||||
|
||||
/**
|
||||
* dnsStrategyId
|
||||
* @return dnsStrategyId
|
||||
*/
|
||||
|
||||
public Integer getDnsStrategyId() {
|
||||
return dnsStrategyId;
|
||||
}
|
||||
/**
|
||||
* @param dnsStrategyId the dnsStrategyId to set
|
||||
*/
|
||||
public void setDnsStrategyId(Integer dnsStrategyId) {
|
||||
this.dnsStrategyId = dnsStrategyId;
|
||||
}
|
||||
@Override
|
||||
public void initDefaultValue(){
|
||||
super.initDefaultValue();
|
||||
this.direction = 0;
|
||||
}
|
||||
|
||||
public String getIndexTable() {
|
||||
return indexTable;
|
||||
}
|
||||
public void setIndexTable(String indexTable) {
|
||||
this.indexTable = indexTable;
|
||||
}
|
||||
public Integer getIndex() {
|
||||
return index;
|
||||
}
|
||||
public void setIndex(Integer index) {
|
||||
this.index = index;
|
||||
}
|
||||
}
|
||||
64
src/main/java/com/nis/domain/basics/UrlCommCfg.java
Normal file
64
src/main/java/com/nis/domain/basics/UrlCommCfg.java
Normal file
@@ -0,0 +1,64 @@
|
||||
package com.nis.domain.basics;
|
||||
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class UrlCommCfg extends BaseStringCfg<UrlCommCfg>{
|
||||
|
||||
private static final long serialVersionUID = 398247881810945300L;
|
||||
private static final String tableName="http_url_cfg";
|
||||
|
||||
@ExcelField(title="key_word",sort=3)
|
||||
protected String cfgKeywords;//url关键字配置
|
||||
|
||||
// protected Integer exprType;//表达式类型
|
||||
// protected Integer matchMethod;//匹配类型
|
||||
protected Integer isHexbin;//是否大小写敏感
|
||||
protected String ratelimit;//限速比例,0到1之间
|
||||
@ExcelField(title="group_name",sort=108)
|
||||
protected String groupName;//公共组名称
|
||||
|
||||
|
||||
|
||||
public String getCfgKeywords() {
|
||||
return cfgKeywords;
|
||||
}
|
||||
public void setCfgKeywords(String cfgKeywords) {
|
||||
this.cfgKeywords = cfgKeywords;
|
||||
}
|
||||
// public Integer getExprType() {
|
||||
// return exprType;
|
||||
// }
|
||||
// public void setExprType(Integer exprType) {
|
||||
// this.exprType = exprType;
|
||||
// }
|
||||
// public Integer getMatchMethod() {
|
||||
// return matchMethod;
|
||||
// }
|
||||
// public void setMatchMethod(Integer matchMethod) {
|
||||
// this.matchMethod = matchMethod;
|
||||
// }
|
||||
public Integer getIsHexbin() {
|
||||
return isHexbin;
|
||||
}
|
||||
public void setIsHexbin(Integer isHexbin) {
|
||||
this.isHexbin = isHexbin;
|
||||
}
|
||||
public String getRatelimit() {
|
||||
return ratelimit;
|
||||
}
|
||||
public void setRatelimit(String ratelimit) {
|
||||
this.ratelimit = ratelimit;
|
||||
}
|
||||
public static String getTablename() {
|
||||
return tableName;
|
||||
}
|
||||
|
||||
public String getGroupName() {
|
||||
return groupName;
|
||||
}
|
||||
public void setGroupName(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -72,8 +72,15 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
||||
* 定时任务信息,2019年1月18日18:54:53 修改
|
||||
*/
|
||||
protected ScheduleCfg schedule;
|
||||
|
||||
private String commonGroupIds; //公共组织id(考虑一个compile存在多个asn组织的情况)
|
||||
protected Integer groupType; //url组以及dns组相关功能使用
|
||||
protected Integer udFlag; //url组以及dns组相关功能使用 过滤数据库数据标记
|
||||
public Integer getGroupType() {
|
||||
return groupType;
|
||||
}
|
||||
public void setGroupType(Integer groupType) {
|
||||
this.groupType = groupType;
|
||||
}
|
||||
public String getCommonGroupIds() {
|
||||
return commonGroupIds;
|
||||
}
|
||||
@@ -81,8 +88,12 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
||||
public void setCommonGroupIds(String commonGroupIds) {
|
||||
this.commonGroupIds = commonGroupIds;
|
||||
}
|
||||
|
||||
|
||||
public Integer getUdFlag() {
|
||||
return udFlag;
|
||||
}
|
||||
public void setUdFlag(Integer udFlag) {
|
||||
this.udFlag = udFlag;
|
||||
}
|
||||
|
||||
public String getExType() {
|
||||
return exType;
|
||||
|
||||
@@ -79,9 +79,16 @@ public class BaseIpCfg extends BaseCfg<BaseIpCfg> {
|
||||
protected String organization; //仅用于copy属性使用
|
||||
protected String country; //仅用于copy属性使用
|
||||
protected String detail; //仅用于copy属性使用
|
||||
protected Integer groupId; //仅用于copy属性使用
|
||||
// @ExcelField(title="log_total",sort=42)
|
||||
private Long totalLogs;
|
||||
|
||||
public Integer getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
public void setGroupId(Integer groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
public String getOrganization() {
|
||||
return organization;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,9 @@ import java.util.Map;
|
||||
import com.google.gson.annotations.Expose;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.basics.IpReuseIpCfg;
|
||||
import com.nis.domain.basics.UrlCommCfg;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
@@ -77,7 +79,6 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
private P2pKeywordCfg p2pKeyword;
|
||||
private List<P2pHashCfg> p2pHashList;
|
||||
private List<P2pKeywordCfg> p2pKeywordList;
|
||||
|
||||
private Integer sourceCompileId;
|
||||
private String searchKeywords;// 列表关键字查询字段
|
||||
|
||||
@@ -88,8 +89,8 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
private List<AsnKeywordCfg> asnKeywords;
|
||||
@ExcelField(title="log_total",sort=42)
|
||||
private Long totalLogs;
|
||||
|
||||
|
||||
private List<UrlCommCfg> urlCommGroupList;
|
||||
private List<IpCommCfg> ipCommGroupCfgList;
|
||||
/*private CachePolicyUserRegion cachePolicyUserRegion;//缓存策略用户自定义域参数
|
||||
|
||||
public static class CachePolicyUserRegion{
|
||||
@@ -98,9 +99,16 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
public String getOrganization() {
|
||||
return organization;
|
||||
}
|
||||
public List<IpCommCfg> getIpCommGroupCfgList() {
|
||||
return ipCommGroupCfgList;
|
||||
}
|
||||
public void setIpCommGroupCfgList(List<IpCommCfg> ipCommGroupCfgList) {
|
||||
this.ipCommGroupCfgList = ipCommGroupCfgList;
|
||||
}
|
||||
public List<AsnKeywordCfg> getAsnKeywords() {
|
||||
return asnKeywords;
|
||||
}
|
||||
@@ -411,4 +419,11 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
||||
public void setTotalLogs(Long totalLogs) {
|
||||
this.totalLogs = totalLogs;
|
||||
}
|
||||
public List<UrlCommCfg> getUrlCommGroupList() {
|
||||
return urlCommGroupList;
|
||||
}
|
||||
public void setUrlCommGroupList(List<UrlCommCfg> urlCommGroupList) {
|
||||
this.urlCommGroupList = urlCommGroupList;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class IpCommCfgTemplate extends IpAllTemplate{
|
||||
@ExcelField(title="ip_group",align=2,sort=10)
|
||||
private Integer groupId;
|
||||
|
||||
public Integer getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(Integer groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSrcIpAddress() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getSrcIpAddress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSrcPort() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getSrcPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDestPort() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDestPort();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getProtocol() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getProtocol();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDirection() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDirection();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getDoLog() {
|
||||
// TODO Auto-generated method stub
|
||||
return super.getDoLog();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -185,6 +185,10 @@ public final class Constants {
|
||||
* DNS 策略组KEY
|
||||
*/
|
||||
public static final String CACHE_DNSGROUP_DICT = "dnsGroupDict";
|
||||
/**
|
||||
* IP 公共策略组KEY
|
||||
*/
|
||||
public static final String CACHE_IP_COMM_GROUP_DICT = "ipCommGroupDict";
|
||||
/**
|
||||
* 词典数据分类
|
||||
*/
|
||||
|
||||
@@ -401,4 +401,24 @@ public class DictUtils {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public static List<PolicyGroupInfo> getIpCommGroups(){
|
||||
List<PolicyGroupInfo> allDictList = (List<PolicyGroupInfo>)CacheUtils.get(Constants.CACHE_IP_COMM_GROUP_DICT);
|
||||
if(StringUtil.isEmpty(allDictList)){
|
||||
allDictList = policyGroupInfoDao.findPolicyGroupInfosByType(5);
|
||||
CacheUtils.put(Constants.CACHE_IP_COMM_GROUP_DICT, allDictList);
|
||||
}
|
||||
return allDictList;
|
||||
}
|
||||
public static PolicyGroupInfo getIpCommGroup(int groupId){
|
||||
List<PolicyGroupInfo> allDictList = getIpCommGroups();
|
||||
if(StringUtil.isEmpty(allDictList)){
|
||||
}else {
|
||||
for(PolicyGroupInfo group:allDictList) {
|
||||
if(group.getServiceGroupId().intValue()==groupId) {
|
||||
return group;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -577,7 +577,26 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (regionDict.getFunctionId().equals(110)) {
|
||||
if(baseIpCfg.getGroupId()==null) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"),prop.getProperty("ip_group","IP Group") + " ") + ";");
|
||||
}else {
|
||||
try {
|
||||
Integer groupId=baseIpCfg.getGroupId();
|
||||
PolicyGroupInfo group = DictUtils.getIpCommGroup(groupId);
|
||||
if (group == null ) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_incorrect"), prop.getProperty("ip_group","IP Group"))
|
||||
+ ";");
|
||||
}
|
||||
}catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("is_in_wrong_format"),prop.getProperty("ip_group","IP Group") + " ") + ";");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (regionDict.getRegionType().equals(1)) {
|
||||
boolean srcIpEmpty = false;
|
||||
boolean destIpEmpty = false;
|
||||
|
||||
@@ -46,6 +46,7 @@ import com.nis.domain.Page;
|
||||
import com.nis.domain.SysDataDictionaryItem;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.basics.ServiceDictInfo;
|
||||
import com.nis.domain.basics.SysDictInfo;
|
||||
import com.nis.domain.configuration.AppComplexFeatureCfg;
|
||||
@@ -98,6 +99,7 @@ import com.nis.domain.configuration.template.HttpsReplaceIpTemplate;
|
||||
import com.nis.domain.configuration.template.HttpsReplaceTemplate;
|
||||
import com.nis.domain.configuration.template.IpAllNotDoLogTemplate;
|
||||
import com.nis.domain.configuration.template.IpAllTemplate;
|
||||
import com.nis.domain.configuration.template.IpCommCfgTemplate;
|
||||
import com.nis.domain.configuration.template.IpPayloadTemplate;
|
||||
import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
||||
import com.nis.domain.configuration.template.IpSpoofingTemplate;
|
||||
@@ -640,6 +642,10 @@ public class BaseController {
|
||||
}
|
||||
}
|
||||
}
|
||||
if(cfg.getGroupType()!=null) {
|
||||
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoService.findPolicyGroupInfosByTypeforUD(cfg.getGroupType(), cfg.getUdFlag());
|
||||
model.addAttribute("policyGroupInfos", policyGroupInfos);
|
||||
}
|
||||
}
|
||||
|
||||
protected void initUpdateFormCondition(Model model, BaseCfg cfg) {
|
||||
@@ -704,6 +710,10 @@ public class BaseController {
|
||||
model.addAttribute("regionList", regionList);
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(cfg.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
if(cfg.getGroupType()!=null) {
|
||||
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoService.findPolicyGroupInfosByTypeforUD(cfg.getGroupType(), cfg.getUdFlag());
|
||||
model.addAttribute("policyGroupInfos", policyGroupInfos);
|
||||
}
|
||||
}
|
||||
|
||||
public List<AreaBean> getAreaIsps(String areaEffectiveIds, List<AreaBean> areaIspList, List<SysDictInfo> isps,
|
||||
@@ -2427,7 +2437,9 @@ public class BaseController {
|
||||
ei.loadInitParams(IpAllNotDoLogTemplate.class, msgProp, regionDict, serviceDict);
|
||||
} else if((regionDict.getFunctionId().equals(63) || regionDict.getFunctionId().equals(407) || regionDict.getFunctionId().equals(408)) && serviceDict.getAction().equals(64)){ // Policies -> Stream
|
||||
ei.loadInitParams(IpRateLimitTemplate.class, msgProp, regionDict, serviceDict);
|
||||
}else {
|
||||
}else if(regionDict.getFunctionId().equals(110)) { // IP白名单
|
||||
ei.loadInitParams(IpCommCfgTemplate.class, msgProp, regionDict, serviceDict);
|
||||
} else {
|
||||
ei.loadInitParams(IpAllTemplate.class, msgProp, regionDict, serviceDict);
|
||||
}
|
||||
} else if (regionDict.getRegionType().equals(2)) {// 字符串类
|
||||
|
||||
@@ -0,0 +1,528 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jets3t.service.ServiceException;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
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.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.beust.jcommander.internal.Lists;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.domain.configuration.BaseCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.template.IpCommCfgTemplate;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.Reflections;
|
||||
import com.nis.util.ServiceConfigTemplateUtil;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.excel.ImportBigExcel;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.basics.IpCommGroupCfgService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/basics/ip")
|
||||
public class IpCommGroupController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private IpCommGroupCfgService ipCommGroupCfgService;
|
||||
|
||||
@RequestMapping(value = { "/list" })
|
||||
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") IpCommCfg entity) {
|
||||
Page<IpCommCfg> page = ipCommGroupCfgService.findPage(new Page<IpCommCfg>(request, response, "r"),
|
||||
entity);
|
||||
model.addAttribute("page", page);
|
||||
// initPageCondition(model);
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
model.addAttribute("regionList", regionList);
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoService.findPolicyGroupInfosByType(5);
|
||||
model.addAttribute("policyGroupInfos", policyGroupInfos);
|
||||
return "/basics/ipCommonGroupCfgList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/addForm" })
|
||||
public String addForm(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes) {
|
||||
|
||||
cfg.setGroupType(5);
|
||||
initFormCondition(model, cfg);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/ipCommGroupFormAdd";
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/save" })
|
||||
@RequiresPermissions(value = { "ip:common:config" })
|
||||
public String save(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") CfgIndexInfo cfg, RedirectAttributes redirectAttributes) {
|
||||
|
||||
// System.out.println("URL分组");
|
||||
try {
|
||||
ipCommGroupCfgService.saveIpCommGroupCfg(cfg);
|
||||
} catch (Exception e) {
|
||||
logger.error("信息保存失败", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", e.getMessage());
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/ip/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/updateForm" })
|
||||
public String updateForm(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||
@ModelAttribute("cfg") IpCommCfg cfg, RedirectAttributes redirectAttributes) {
|
||||
cfg = ipCommGroupCfgService.get(Long.parseLong(ids));
|
||||
// initUpdateFormCondition(model, cfg);
|
||||
cfg.setGroupType(5);
|
||||
initUpdateFormCondition(model, cfg);
|
||||
// List<ConfigGroupInfo> groupInfos=configGroupInfoService.findAllList(4);
|
||||
// model.addAttribute("policyGroups", groupInfos);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/ipCommGroupFormUpdate";
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/update" })
|
||||
@RequiresPermissions(value = { "ip:common:config" })
|
||||
public String update(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") IpCommCfg cfg, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
ipCommGroupCfgService.update(cfg);
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("信息保存失败", e);
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/ip/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/audit" })
|
||||
@RequiresPermissions(value = { "ip:common:config" })
|
||||
public String audit(Model model, @ModelAttribute("cfg") IpCommCfg cfg, Integer isAudit, Integer isValid,
|
||||
String ids, Integer functionId, HttpServletRequest request, HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
// 选中配置审核
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
List<IpCommCfg> ipGroupCfgs = ipCommGroupCfgService.getByIds(ids);
|
||||
List<IpCommCfg> temp = Lists.newArrayList();
|
||||
try {
|
||||
ipCommGroupCfgService.audit(ipGroupCfgs, isAudit, isValid);
|
||||
} catch (Exception e) {
|
||||
logger.error("审核失败", e);
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
} finally {
|
||||
temp.clear();
|
||||
}
|
||||
return "redirect:" + adminPath + "/basics/ip/list?functionId=" + cfg.getFunctionId();
|
||||
} else {// 全部审核
|
||||
// 条件下所有配置审核
|
||||
Page<IpCommCfg> searchPage = new Page<IpCommCfg>(request, response, "a");
|
||||
Page<IpCommCfg> auditPage = new Page<IpCommCfg>(request, response, "a");
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
|
||||
try {
|
||||
auditAll(auditPage, isValid, cfg);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return list(model, request, response, cfg);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = { "/delete" })
|
||||
@RequiresPermissions(value = { "ip:common:config" })
|
||||
public String delete(Integer isValid, String ids, Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
ipCommGroupCfgService.delete(ids);
|
||||
addMessage(redirectAttributes, "success", "delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("Delete failed", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", e.getMessage());
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "delete_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath + "/basics/ip/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
// ipComm配置导出
|
||||
@RequestMapping(value = "/exportIpComm")
|
||||
public void exportIpCommonCfg(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") IpCommCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
List<IpCommCfg> list = new ArrayList<IpCommCfg>();
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
list = ipCommGroupCfgService.findByPage(ids);
|
||||
} else {
|
||||
Page<IpCommCfg> pageInfo = new Page<IpCommCfg>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<IpCommCfg> page = ipCommGroupCfgService.findPage(pageInfo, entity);
|
||||
list = page.getList();
|
||||
}
|
||||
//
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), IpPortCfg.class);
|
||||
String cfgIndexInfoNoExport = ",block_type,do_log,action"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,src_ip_pattern,client_ip,src_port_pattern,client_port,dest_ip_pattern,dest_port_pattern,dest_port,";
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), list);
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("IpCommGroupCfg export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量审核
|
||||
*
|
||||
* @param isAudit
|
||||
* @param isValid
|
||||
* @param ids
|
||||
* @param functionId
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void auditAll(Page page, Integer auditType, Object entity) throws Exception {
|
||||
long start = System.currentTimeMillis();
|
||||
page.setOrderBy("");
|
||||
page.setPageSize(Constants.MAAT_JSON_SEND_SIZE);
|
||||
page.setPageNo(1);
|
||||
page.setLastPage(false);
|
||||
// 携带审核状态信息的BaseCfg
|
||||
BaseCfg auditBatchCfg = new BaseCfg();
|
||||
// 携带审核条件的BaseCfg
|
||||
IpCommCfg searchIpCommGroupCfg = new IpCommCfg();
|
||||
BeanUtils.copyProperties(entity, auditBatchCfg);
|
||||
BeanUtils.copyProperties(entity, searchIpCommGroupCfg);
|
||||
|
||||
auditType = (Integer) Reflections.invokeGetter(entity, "isAudit");
|
||||
|
||||
// 全部审核通过,只查询当前条件下的所有未审核的配置 -批量审核通过/不通过
|
||||
if (auditType.equals(1) || auditType.equals(2)) {
|
||||
|
||||
searchIpCommGroupCfg.setIsValid(0);
|
||||
searchIpCommGroupCfg.setIsAudit(0);
|
||||
|
||||
if (auditType.equals(1)) {
|
||||
auditBatchCfg.setIsAudit(1);
|
||||
auditBatchCfg.setIsValid(1);
|
||||
} else {
|
||||
auditBatchCfg.setIsAudit(2);
|
||||
auditBatchCfg.setIsValid(0);
|
||||
}
|
||||
auditBatchCfg.setAuditTime(new Date());
|
||||
auditBatchCfg.setAuditorId(UserUtils.getUser().getId());
|
||||
} else {
|
||||
// 全部取消通过,只查询当前条件下的所有审核通过的配置
|
||||
searchIpCommGroupCfg.setIsValid(1);
|
||||
searchIpCommGroupCfg.setIsAudit(1);
|
||||
|
||||
auditBatchCfg.setIsAudit(3);
|
||||
auditBatchCfg.setIsValid(0);
|
||||
auditBatchCfg.setAuditTime(new Date());
|
||||
auditBatchCfg.setAuditorId(UserUtils.getUser().getId());
|
||||
}
|
||||
|
||||
ServiceConfigTemplateUtil serviceTemplate = new ServiceConfigTemplateUtil();
|
||||
Integer functionId = 0;
|
||||
if (auditBatchCfg != null && !StringUtil.isEmpty(auditBatchCfg.getFunctionId())) {
|
||||
functionId = auditBatchCfg.getFunctionId();
|
||||
}
|
||||
List<Map<String, Object>> serviceList = serviceTemplate.getServiceListByFunctionId(functionId);
|
||||
for (Map<String, Object> service : serviceList) {
|
||||
String tableNameXml = service.get("tableName").toString(); // 获取业务主配置表
|
||||
String serviceTypeXml = service.get("serviceType").toString(); // 业务类型 1maat 2callback
|
||||
String classNameXml = service.get("className").toString(); // 主配置Java类
|
||||
String serviceIdXml = service.get("id").toString(); // service字典表 service_id字段
|
||||
auditBatchCfg.setServiceId(Integer.valueOf(serviceIdXml));
|
||||
auditBatchCfg.setTableName(tableNameXml);
|
||||
searchIpCommGroupCfg.setServiceId(Integer.valueOf(serviceIdXml));
|
||||
searchIpCommGroupCfg.setTableName(tableNameXml);
|
||||
|
||||
if ("1".equals(serviceTypeXml)) {// maat类配置
|
||||
// 存放域配置类型 及 对应表名
|
||||
List<Map<String, Object>> cfgList = (List<Map<String, Object>>) service.get("cfgList");
|
||||
List<Map<String, Object>> userRegionList = (List<Map<String, Object>>) service.get("userRegionList");
|
||||
int cfgType = Integer.parseInt(service.get("cfgType").toString());
|
||||
if (auditBatchCfg.getIsAudit() == 1) {
|
||||
boolean hasData = true;
|
||||
|
||||
while (hasData) {
|
||||
page.setPageNo(1);
|
||||
page.setLastPage(false);
|
||||
List list = ipCommGroupCfgService.findPage(page, searchIpCommGroupCfg).getList();
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
Map<Integer,List> groupIdMap=new HashMap();
|
||||
// 配置生效处理
|
||||
if(auditBatchCfg.getIsAudit().equals(1)) {
|
||||
hasData=commonPolicyService.auditReuseCommonConfigData(page, auditBatchCfg,groupIdMap,hasData);
|
||||
Map<Integer,List> groupIpMap=new HashMap();
|
||||
if(CollectionUtils.isNotEmpty(list)) {
|
||||
for (IpCommCfg obj : (List<IpCommCfg>)list) {
|
||||
BaseCfg baseCfg=(BaseCfg)obj;
|
||||
if(!StringUtil.isEmpty(obj.getGroupId())) {
|
||||
groupIdMap.get(obj.getGroupId()).add(baseCfg);
|
||||
}else {
|
||||
List newList=new ArrayList<>();
|
||||
newList.add(baseCfg);
|
||||
groupIdMap.put(obj.getGroupId(),newList);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if(hasData) {
|
||||
page.setPageNo(1);
|
||||
page.setLastPage(false);
|
||||
}
|
||||
}else{
|
||||
hasData = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
throw new RuntimeException("wrong service type " + serviceTypeXml);
|
||||
}
|
||||
}
|
||||
|
||||
// 批量审核通过时,如果没有携带isValid检索条件,返回界面需要将isValid置为null
|
||||
if (!StringUtil.isEmpty(entity)) {
|
||||
BaseCfg base = (BaseCfg) entity;
|
||||
if (!StringUtil.isEmpty(base.getSeltype()) && base.getSeltype().equals("isValid")) {
|
||||
base.setIsValid(null);
|
||||
BeanUtils.copyProperties(base, entity);
|
||||
}
|
||||
}
|
||||
long end = System.currentTimeMillis();
|
||||
logger.warn("配置批量生效/失效耗时:" + (end - start));
|
||||
}
|
||||
@RequestMapping(value = "import", method=RequestMethod.POST)
|
||||
public String importIp(HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
||||
@RequestParam("files") MultipartFile[] files
|
||||
,Integer serviceDictId
|
||||
,Integer requestId
|
||||
,String attribute
|
||||
,String classify
|
||||
,String regionDictIds
|
||||
,String importPath) {
|
||||
logger.warn("import start...");
|
||||
long start=System.currentTimeMillis();
|
||||
ImportBigExcel ei=null;
|
||||
try {
|
||||
FunctionServiceDict serviceDict = DictUtils.getFunctionServiceDict(serviceDictId);
|
||||
StringBuffer errTip=new StringBuffer();
|
||||
BlockingQueue<BaseIpCfg> ipPortCfgs =null;
|
||||
//List<CfgIndexInfo> cfgIndexInfos = new ArrayList<CfgIndexInfo>();
|
||||
for (int i = 0; i < files.length; i++) {
|
||||
MultipartFile file = files[i];
|
||||
ei = new ImportBigExcel(file, 0, 1);
|
||||
FunctionRegionDict regionDict = DictUtils
|
||||
.getFunctionRegionDict(Integer.parseInt(regionDictIds.split(",")[i]));
|
||||
//加载模板
|
||||
loadTemplate(ei,regionDict, serviceDict);
|
||||
//------------------------------------check format start----------------------------
|
||||
if (regionDict.getRegionType().equals(1)) {// IP
|
||||
BlockingQueue<IpCommCfgTemplate> list = ei.getDataList(IpCommCfgTemplate.class );
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,null, list);
|
||||
}
|
||||
//删除文件
|
||||
if(ei.getUploadFile()!=null&&ei.getUploadFile().exists()) {
|
||||
ei.getUploadFile().delete();
|
||||
}
|
||||
//------------------------------------check format end----------------------------
|
||||
Date date = new Date();
|
||||
String isSend = request.getParameter("isSend")==null?"":request.getParameter("isSend");
|
||||
|
||||
if (regionDict.getRegionType().equals(1)) {// IP
|
||||
List<BaseIpCfg> _ipPortCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||
while(!ipPortCfgs.isEmpty()) {
|
||||
ipPortCfgs.drainTo(_ipPortCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||
List<Integer> regionIds=Lists.newArrayList();
|
||||
List<Integer> numRegionGroupIds=Lists.newArrayList();
|
||||
List<Integer> numRegionRegionIds=Lists.newArrayList();
|
||||
if(!regionDict.getFunctionId().equals(405)) {//app ip compileId 从config_group_info中取
|
||||
try {
|
||||
if(isSend.equals("1")) {
|
||||
regionIds = ConfigServiceUtil.getId(3,_ipPortCfgs.size());
|
||||
//需要获取数值域的id
|
||||
if(serviceDict!=null&&serviceDict.getProtocolId()!=null&&serviceDict.getProtocolId()>0) {
|
||||
numRegionGroupIds = ConfigServiceUtil.getId(2,_ipPortCfgs.size());
|
||||
numRegionRegionIds = ConfigServiceUtil.getId(3,_ipPortCfgs.size());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
}else {
|
||||
try {
|
||||
regionIds = ConfigServiceUtil.getId(3,_ipPortCfgs.size());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取域ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
}
|
||||
int ind=0;
|
||||
for (BaseIpCfg cfg : _ipPortCfgs) {
|
||||
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
||||
/*cfg.setAuditorId(UserUtils.getUser().getId());
|
||||
cfg.setAuditTime(date);*/
|
||||
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
cfg.setCreateTime(date);
|
||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
//cfg.setDoLog(2);
|
||||
cfg.setFunctionId(regionDict.getFunctionId());
|
||||
if(isSend.equals("1")) {
|
||||
cfg.setIsAudit(Constants.AUDIT_YES);
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||
cfg.setAuditTime(date);
|
||||
if(regionIds!=null&®ionIds.size()==_ipPortCfgs.size()) {
|
||||
cfg.setRegionId(regionIds.get(ind));
|
||||
}
|
||||
if(serviceDict!=null&&serviceDict.getProtocolId()!=null) {
|
||||
if(numRegionGroupIds!=null&&numRegionGroupIds.size()==_ipPortCfgs.size()) {
|
||||
cfg.setNumberRegionGroupId(numRegionGroupIds.get(ind));
|
||||
}
|
||||
if(numRegionRegionIds!=null&&numRegionRegionIds.size()==_ipPortCfgs.size()) {
|
||||
cfg.setNumberRegionRegionId(numRegionRegionIds.get(ind));
|
||||
}
|
||||
}
|
||||
}else {
|
||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
}
|
||||
cfg.setIsAreaEffective(0);
|
||||
cfg.setLable("0");
|
||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||
cfg.setAttribute(attribute);
|
||||
cfg.setClassify(classify);
|
||||
cfg.setServiceId(serviceDict==null?null:serviceDict.getServiceId());
|
||||
cfg.setTableName("ip_comm_cfg");
|
||||
ind++;
|
||||
}
|
||||
ipCommGroupCfgService.saveAndSend(regionDict, serviceDict, _ipPortCfgs,isSend.equals("1"));
|
||||
_ipPortCfgs.clear();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
if(errTip.toString().length()>0) {
|
||||
addMessage(redirectAttributes,"error", errTip.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
if(ei!=null) {
|
||||
if(ei.getUploadFile().exists()) {
|
||||
ei.getUploadFile().delete();
|
||||
}
|
||||
}
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else if(e instanceof ServiceException) {
|
||||
addMessage(redirectAttributes,"error", e.getMessage());
|
||||
}else if(e instanceof IndexOutOfBoundsException){
|
||||
addMessage(redirectAttributes,"error", "template_error");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "import_failed");
|
||||
}
|
||||
logger.error("import failed", e);
|
||||
}
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("import finish,cost:"+(end-start));
|
||||
return "redirect:" + adminPath+ importPath;
|
||||
}
|
||||
@RequestMapping(value="ajaxGetGroups",method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Map<Integer,String> ajaxGetGroups(Model model,@RequestParam(required=true,value="groupIds")String groupIds){
|
||||
Map<Integer,String> groupIdList=new HashMap<Integer,String>();
|
||||
if(StringUtils.isNotBlank(groupIds)) {
|
||||
List<PolicyGroupInfo> list=policyGroupInfoService.findPolicyByServiceGroupInfoList(groupIds);
|
||||
for(PolicyGroupInfo p:list) {
|
||||
groupIdList.put(p.getServiceGroupId(), p.getGroupName());
|
||||
}
|
||||
}
|
||||
return groupIdList;
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.PolicyGroupInfo;
|
||||
import com.nis.util.Constants;
|
||||
@@ -122,6 +123,19 @@ public class PolicyGroupController extends BaseController {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@RequestMapping(value="ajaxGetPagedGroup",method=RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Page ajaxGetPagedGroup(HttpServletRequest request
|
||||
, HttpServletResponse response,Model model,@RequestParam(required=true,value="type")Integer type,@RequestParam(required=true,value="pageNo")Integer pageNo,@RequestParam(required=true,value="pageSize")Integer pageSize){
|
||||
|
||||
PolicyGroupInfo cfg=new PolicyGroupInfo();
|
||||
cfg.setGroupType(type);
|
||||
Page<PolicyGroupInfo> pageCondition = new Page<PolicyGroupInfo>(request, response,"r");
|
||||
pageCondition.setPageNo(pageNo);
|
||||
pageCondition.setPageSize(pageSize);
|
||||
Page page = policyGroupInfoService.findPolicyGroupInfoList(pageCondition,cfg);
|
||||
return page;
|
||||
}
|
||||
/**
|
||||
* 校验asn号是否已存在
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.UrlCommCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.service.basics.UrlCommGroupService;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/basics/url")
|
||||
public class UrlCommGroupController extends BaseController{
|
||||
|
||||
@Autowired
|
||||
private UrlCommGroupService urlCommGroupService;
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,@ModelAttribute("cfg")UrlCommCfg entity
|
||||
){
|
||||
Page<UrlCommCfg> page = urlCommGroupService.findPage(new Page<UrlCommCfg>(request, response,"r"), entity);
|
||||
model.addAttribute("page", page);
|
||||
|
||||
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||
model.addAttribute("regionList", regionList);
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
return "/basics/urlCommGroupList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/addForm"})
|
||||
public String addForm(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
|
||||
|
||||
// UrlCommGroupCfg urlCfg = new UrlCommGroupCfg();
|
||||
// urlCfg.setCfgType("NTC_URL_REGION");
|
||||
// cfg.setUrlCommGroupCfg(urlCfg);
|
||||
// List<UrlCommGroupCfg> urlList = new ArrayList<UrlCommGroupCfg>();
|
||||
// urlList.add(urlCfg);
|
||||
// cfg.setUrlCommGroupList(urlList);
|
||||
// initFormCondition(model, entity);
|
||||
cfg.setGroupType(11);
|
||||
initFormCondition(model,cfg);
|
||||
//List<ConfigGroupInfo> groupInfos=configGroupInfoService.findAllList(4);
|
||||
//model.addAttribute("policyGroups", groupInfos);
|
||||
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/urlCommGroupFormAdd";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/save"})
|
||||
@RequiresPermissions(value={"http:url:config"})
|
||||
public String save(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes){
|
||||
|
||||
// System.out.println("URL分组");
|
||||
try{
|
||||
urlCommGroupService.saveUrlCommGroupCfg(cfg);
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/url/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/updateForm"})
|
||||
public String updateForm(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,String ids,@ModelAttribute("cfg")UrlCommCfg cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
cfg = urlCommGroupService.get(Long.parseLong(ids));
|
||||
// initUpdateFormCondition(model, cfg);
|
||||
cfg.setGroupType(11);
|
||||
initUpdateFormCondition(model,cfg);
|
||||
//List<ConfigGroupInfo> groupInfos=configGroupInfoService.findAllList(4);
|
||||
//model.addAttribute("policyGroups", groupInfos);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/basics/urlCommGroupFormUpdate";
|
||||
}
|
||||
@RequestMapping(value = {"/update"})
|
||||
@RequiresPermissions(value={"http:url:config"})
|
||||
public String update(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")UrlCommCfg cfg,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
urlCommGroupService.update(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/url/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/audit"})
|
||||
@RequiresPermissions(value={"http:url:config"})
|
||||
public String audit(Model model,@ModelAttribute("cfg")UrlCommCfg cfg
|
||||
,Integer isAudit
|
||||
,Integer isValid
|
||||
,String ids
|
||||
,Integer functionId
|
||||
, HttpServletRequest request
|
||||
,HttpServletResponse response
|
||||
,RedirectAttributes redirectAttributes) {
|
||||
//选中配置审核
|
||||
if(!StringUtil.isEmpty(ids)) {
|
||||
List<UrlCommCfg> urlGroupCfgs=urlCommGroupService.getByIds(ids);
|
||||
// Map<Long,List<UrlCommGroupCfg>> urlcfgMap=Maps.newHashMap();
|
||||
// for(UrlCommGroupCfg urlCommCfg:urlGroupCfgs) {
|
||||
// urlCommCfg.setIsAudit(isAudit);
|
||||
// urlCommCfg.setIsValid(isValid);
|
||||
// urlCommCfg.setAuditorId(UserUtils.getUser().getId());
|
||||
// urlCommCfg.setAuditTime(new Date());
|
||||
// urlCommCfg.setFunctionId(functionId);
|
||||
// if(urlcfgMap.containsKey(Long.parseLong(urlCommCfg.getUserRegion3()))) {
|
||||
// urlcfgMap.get(Long.parseLong(urlCommCfg.getUserRegion3())).add(urlCommCfg);
|
||||
// }else {
|
||||
// List<UrlCommGroupCfg> _urlCfgs=Lists.newArrayList();
|
||||
// _urlCfgs.add(urlCommCfg);
|
||||
// urlcfgMap.put(Long.parseLong(urlCommCfg.getUserRegion3()), _urlCfgs);
|
||||
// }
|
||||
// }
|
||||
/********************每次下发一个组的region,保证事物********************/
|
||||
// for (Long groupId : urlcfgMap.keySet()) {
|
||||
// try {
|
||||
// urlCommGroupService.audit(urlcfgMap.get(groupId),groupId,isValid);
|
||||
// } catch (Exception e) {
|
||||
// logger.error("配置下发失败:",e);
|
||||
// if(e instanceof MaatConvertException) {
|
||||
// addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
// }else {
|
||||
// addMessage(redirectAttributes,"error", "audit_failed");
|
||||
// }
|
||||
//
|
||||
// }
|
||||
// }
|
||||
for (UrlCommCfg urlCommGroup : urlGroupCfgs) {
|
||||
try {
|
||||
urlCommGroupService.audit(urlCommGroup,isAudit,isValid);
|
||||
} catch (Exception e) {
|
||||
logger.error("审核失败",e);
|
||||
addMessage(redirectAttributes,"error","audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/basics/url/list?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/delete"})
|
||||
@RequiresPermissions(value={"http:url:config"})
|
||||
public String delete(Integer isValid
|
||||
,String ids,Integer functionId
|
||||
,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
urlCommGroupService.delete(ids);
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error("Delete failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error",e.getMessage());
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/basics/url/list?functionId="+functionId;
|
||||
}
|
||||
//urlComm配置导出
|
||||
@RequestMapping(value = "/exportUrlComm")
|
||||
public void exportAsnIp(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")UrlCommCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
List<UrlCommCfg> list = new ArrayList<UrlCommCfg>();
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
list = urlCommGroupService.findByPage(ids);
|
||||
} else {
|
||||
Page<UrlCommCfg> pageInfo=new Page<UrlCommCfg>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<UrlCommCfg> page = urlCommGroupService.findPage(pageInfo, entity);
|
||||
list=page.getList();
|
||||
}
|
||||
//
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), UrlCommCfg.class);
|
||||
String cfgIndexInfoNoExport=",block_type,do_log,action"
|
||||
+ ",letter,whether_area_block,classification,attribute,label,expression_type,match_method"
|
||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,asn_no,is_hex,is_case_insenstive,";
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null ) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), list);
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("urlGroupConfig export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
}
|
||||
@@ -55,6 +55,7 @@ import com.nis.domain.configuration.template.HttpsReplaceIpTemplate;
|
||||
import com.nis.domain.configuration.template.HttpsReplaceTemplate;
|
||||
import com.nis.domain.configuration.template.IpAllNotDoLogTemplate;
|
||||
import com.nis.domain.configuration.template.IpAllTemplate;
|
||||
import com.nis.domain.configuration.template.IpCommCfgTemplate;
|
||||
import com.nis.domain.configuration.template.IpPayloadTemplate;
|
||||
import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
||||
import com.nis.domain.configuration.template.IpSpoofingTemplate;
|
||||
@@ -476,6 +477,11 @@ public class IpController extends BaseController{
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpRateLimitTemplate.class, 2);
|
||||
excel.setDataList(pro,classList,null).
|
||||
write(request,response, fileName).dispose();
|
||||
}else if(regionDict.getFunctionId().equals(110)){
|
||||
List<IpCommCfgTemplate> classList=new ArrayList<IpCommCfgTemplate>();
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpCommCfgTemplate.class, 2);
|
||||
excel.setDataList(pro,classList,null).
|
||||
write(request,response, fileName).dispose();
|
||||
}else{
|
||||
List<IpAllTemplate> classList=new ArrayList<IpAllTemplate>();
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpAllTemplate.class, 2);
|
||||
|
||||
28
src/main/java/com/nis/web/dao/basics/IpCommGroupCfgDao.java
Normal file
28
src/main/java/com/nis/web/dao/basics/IpCommGroupCfgDao.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.nis.web.dao.basics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.basics.Varibles;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
@MyBatisDao
|
||||
public interface IpCommGroupCfgDao extends CrudDao<IpCommCfg>{
|
||||
public List<IpCommCfg> findPage(IpCommCfg cfg);
|
||||
public List<IpCommCfg> findByPage(@Param("ids")String ids);
|
||||
public void delete(@Param("ids")String ids);
|
||||
public void updateIssued(IpCommCfg cfg);
|
||||
public List<IpCommCfg> getByIds(@Param("ids")String ids);
|
||||
public List<IpCommCfg> findAllList(IpCommCfg cfg);
|
||||
public List<Integer> findOtherIps(@Param("groupId")Integer groupId,@Param("cfgId")Integer cfgId);
|
||||
public List<Integer> countValidIPs(@Param("groups")String groups,@Param("ids")String ids);
|
||||
public int insertBatch(List<IpCommCfg> list);
|
||||
public Varibles getVaribles(@Param("name")String name);
|
||||
public void ajaxDeleteAsnIp(@Param("ids")String ids);
|
||||
public IpCommCfg getOne(IpCommCfg cfg);
|
||||
public List<Object[]> findAllIpCommGroupCfgList();
|
||||
public void insertIpCommGroupCfg(IpCommCfg ipPortCfg);
|
||||
public int getGroupIdCount(int groupId);
|
||||
}
|
||||
514
src/main/java/com/nis/web/dao/basics/IpCommGroupCfgDao.xml
Normal file
514
src/main/java/com/nis/web/dao/basics/IpCommGroupCfgDao.xml
Normal file
@@ -0,0 +1,514 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.basics.IpCommGroupCfgDao">
|
||||
<resultMap id="IpCommGroupCfgMap" type="com.nis.domain.basics.IpCommCfg">
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
||||
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
|
||||
<result column="src_ip_pattern" property="srcIpPattern" jdbcType="INTEGER" />
|
||||
<result column="dest_ip_pattern" property="destIpPattern" jdbcType="INTEGER" />
|
||||
<result column="src_ip_address" property="srcIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="dest_ip_address" property="destIpAddress" jdbcType="VARCHAR" />
|
||||
<result column="port_pattern" property="portPattern" jdbcType="INTEGER" />
|
||||
<result column="src_port" property="srcPort" jdbcType="VARCHAR" />
|
||||
<result column="dest_port" property="destPort" jdbcType="VARCHAR" />
|
||||
<result column="direction" property="direction" jdbcType="INTEGER" />
|
||||
<result column="protocol" property="protocol" jdbcType="INTEGER" />
|
||||
<result column="protocol_id" property="protocolId" jdbcType="INTEGER" />
|
||||
<result column="action" property="action" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
||||
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
||||
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
||||
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
|
||||
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
|
||||
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
||||
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
||||
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
||||
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
|
||||
<result column="classify" property="classify" jdbcType="VARCHAR" />
|
||||
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
|
||||
<result column="lable" property="lable" jdbcType="VARCHAR" />
|
||||
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="ratelimit" property="ratelimit" jdbcType="VARCHAR" />
|
||||
<result column="region_id" property="regionId" jdbcType="INTEGER" />
|
||||
<result column="group_id" property="groupId" jdbcType="INTEGER" />
|
||||
<result column="user_region1" property="userRegion1" jdbcType="VARCHAR" />
|
||||
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
||||
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
||||
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
||||
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="columns">
|
||||
r.cfg_id,r.cfg_desc,r.cfg_type,r.cfg_region_code,r.ip_type,r.src_ip_pattern,r.src_ip_address,r.dest_ip_pattern,r.dest_ip_address,
|
||||
r.src_port_pattern,r.src_port,r.dest_port_pattern,r.dest_port
|
||||
,r.protocol,r.protocol_id,r.direction,r.action
|
||||
,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id
|
||||
,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id,
|
||||
r.is_area_effective,r.classify,r.attribute,r.lable
|
||||
,r.area_effective_ids,r.function_id,r.user_region1
|
||||
,r.user_region2,r.user_region3,r.user_region4,r.user_region5,r.compile_id,r.region_id,r.group_id
|
||||
</sql>
|
||||
|
||||
<select id="findPage" resultMap="IpCommGroupCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
<trim prefix="," prefixOverrides=",">
|
||||
,s.name as creator_name,e.name as editor_name,u.name as auditor_name
|
||||
</trim>
|
||||
from ip_comm_cfg r
|
||||
left join sys_user s on r.creator_id=s.id
|
||||
left join sys_user e on r.editor_id=e.id
|
||||
left join sys_user u on r.auditor_id=u.id
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="page !=null and page.where != null and page.where != ''">
|
||||
AND ${page.where}
|
||||
</if>
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgRegionCode != null">
|
||||
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''">
|
||||
AND r.CFG_TYPE like concat(concat('%',#{CFG_TYPE,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="ipType != null">
|
||||
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpPattern != null">
|
||||
AND r.src_ip_pattern=#{srcIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destIpPattern != null">
|
||||
AND r.dest_ip_pattern=#{destIpPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''">
|
||||
AND r.SRC_IP_ADDRESS=#{srcIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destIpAddress != null and destIpAddress != ''">
|
||||
AND r.DEST_IP_ADDRESS=#{destIpAddress,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="srcPortPattern != null">
|
||||
AND r.src_port_pattern=#{srcPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="destPortPattern != null">
|
||||
AND r.dest_port_pattern=#{destPortPattern,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort !=''">
|
||||
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="destPort != null and destPort !=''">
|
||||
AND r.DEST_PORT=#{destPort,jdbcType=VARCHAR}
|
||||
</if>
|
||||
<if test="direction != null">
|
||||
AND r.DIRECTION=#{direction,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="protocol != null">
|
||||
AND r.PROTOCOL=#{protocol,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="protocolId != null">
|
||||
AND r.PROTOCOL_ID=#{protocolId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="action != null">
|
||||
AND r.ACTION=#{action,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid == null">
|
||||
AND r.IS_VALID != -1
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="creatorName != null and creatorName !=''">
|
||||
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="createTime != null and createTime !=''">
|
||||
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editorName != null and editorName !=''">
|
||||
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="editTime != null and editTime !='' ">
|
||||
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="auditorName != null and auditorName !=''">
|
||||
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="auditTime != null and auditTime !=''">
|
||||
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="serviceId != null">
|
||||
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="regionId != null">
|
||||
AND r.region_id=#{regionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isAreaEffective != null">
|
||||
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="classify != null and classify !=''">
|
||||
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="attribute != null and attribute !=''">
|
||||
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="lable != null and lable !=''">
|
||||
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null and areaEffectiveIds !=''">
|
||||
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="userRegion3 != null">
|
||||
AND r.user_region3 like concat(concat('%',#{userRegion3,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
|
||||
<!-- 数据范围过滤 -->
|
||||
${sqlMap.dsf}
|
||||
</trim>
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY r.CFG_ID desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
<select id="get" resultMap="IpCommGroupCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from ip_comm_cfg r
|
||||
where r.cfg_id=#{cfgId}
|
||||
</select>
|
||||
<select id="getByIds" resultMap="IpCommGroupCfgMap">
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from ip_comm_cfg r
|
||||
where r.cfg_id in (${ids}) and is_valid !=-1
|
||||
</select>
|
||||
<select id="getByAsnNo" resultMap="IpCommGroupCfgMap" parameterType="java.lang.Long" >
|
||||
select
|
||||
<include refid="columns"></include>
|
||||
from ip_comm_cfg r where r.is_valid!=-1 and r.user_region1=#{asnId}
|
||||
</select>
|
||||
<insert id="insertIpCommGroupCfg" parameterType="com.nis.domain.basics.IpCommCfg" >
|
||||
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into ip_comm_cfg (
|
||||
CFG_DESC,
|
||||
ACTION,
|
||||
IS_VALID,
|
||||
IS_AUDIT,
|
||||
CREATOR_ID,
|
||||
CREATE_TIME,
|
||||
EDITOR_ID,
|
||||
EDIT_TIME,
|
||||
AUDITOR_ID,
|
||||
AUDIT_TIME,
|
||||
SERVICE_ID,
|
||||
REQUEST_ID,
|
||||
REGION_ID,
|
||||
GROUP_ID,
|
||||
COMPILE_ID,
|
||||
IS_AREA_EFFECTIVE,
|
||||
CLASSIFY,
|
||||
ATTRIBUTE,
|
||||
LABLE,
|
||||
AREA_EFFECTIVE_IDS,
|
||||
FUNCTION_ID,
|
||||
IP_TYPE,
|
||||
SRC_IP_ADDRESS,
|
||||
SRC_IP_PATTERN,
|
||||
DEST_IP_PATTERN,
|
||||
SRC_PORT_PATTERN,
|
||||
DEST_PORT_PATTERN,
|
||||
SRC_PORT,
|
||||
PROTOCOL,
|
||||
PROTOCOL_ID,
|
||||
DIRECTION,
|
||||
DEST_PORT,
|
||||
DEST_IP_ADDRESS,
|
||||
CFG_TYPE,
|
||||
CFG_REGION_CODE,
|
||||
USER_REGION1,
|
||||
USER_REGION2,
|
||||
USER_REGION3,
|
||||
USER_REGION4,
|
||||
USER_REGION5,
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
#{isValid,jdbcType=INTEGER},
|
||||
#{isAudit,jdbcType=INTEGER},
|
||||
#{creatorId,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{editorId,jdbcType=INTEGER},
|
||||
#{editTime,jdbcType=TIMESTAMP},
|
||||
#{auditorId,jdbcType=INTEGER},
|
||||
#{auditTime,jdbcType=TIMESTAMP},
|
||||
#{serviceId,jdbcType=INTEGER},
|
||||
#{requestId,jdbcType=INTEGER},
|
||||
#{regionId,jdbcType=INTEGER},
|
||||
#{groupId,jdbcType=INTEGER},
|
||||
#{compileId,jdbcType=INTEGER},
|
||||
#{isAreaEffective,jdbcType=INTEGER},
|
||||
#{classify,jdbcType=VARCHAR},
|
||||
#{attribute,jdbcType=VARCHAR},
|
||||
#{lable,jdbcType=VARCHAR},
|
||||
#{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
#{direction,jdbcType=INTEGER},
|
||||
#{destPort,jdbcType=VARCHAR},
|
||||
#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{cfgType,jdbcType=VARCHAR},
|
||||
#{cfgRegionCode,jdbcType=INTEGER},
|
||||
#{userRegion1,jdbcType=VARCHAR},
|
||||
#{userRegion2,jdbcType=VARCHAR},
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
#{userRegion4,jdbcType=VARCHAR},
|
||||
#{userRegion5,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertForBatch" parameterType="com.nis.domain.basics.IpCommCfg" >
|
||||
insert into ip_comm_cfg (
|
||||
CFG_DESC,
|
||||
ACTION,
|
||||
IS_VALID,
|
||||
IS_AUDIT,
|
||||
CREATOR_ID,
|
||||
CREATE_TIME,
|
||||
EDITOR_ID,
|
||||
EDIT_TIME,
|
||||
AUDITOR_ID,
|
||||
AUDIT_TIME,
|
||||
SERVICE_ID,
|
||||
REQUEST_ID,
|
||||
REGION_ID,
|
||||
GROUP_ID,
|
||||
COMPILE_ID,
|
||||
IS_AREA_EFFECTIVE,
|
||||
CLASSIFY,
|
||||
ATTRIBUTE,
|
||||
LABLE,
|
||||
AREA_EFFECTIVE_IDS,
|
||||
FUNCTION_ID,
|
||||
IP_TYPE,
|
||||
SRC_IP_ADDRESS,
|
||||
SRC_IP_PATTERN,
|
||||
DEST_IP_PATTERN,
|
||||
SRC_PORT_PATTERN,
|
||||
DEST_PORT_PATTERN,
|
||||
SRC_PORT,
|
||||
PROTOCOL,
|
||||
PROTOCOL_ID,
|
||||
DIRECTION,
|
||||
DEST_PORT,
|
||||
DEST_IP_ADDRESS,
|
||||
CFG_TYPE,
|
||||
CFG_REGION_CODE,
|
||||
USER_REGION1,
|
||||
USER_REGION2,
|
||||
USER_REGION3,
|
||||
USER_REGION4,
|
||||
USER_REGION5
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
#{isValid,jdbcType=INTEGER},
|
||||
#{isAudit,jdbcType=INTEGER},
|
||||
#{creatorId,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{editorId,jdbcType=INTEGER},
|
||||
#{editTime,jdbcType=TIMESTAMP},
|
||||
#{auditorId,jdbcType=INTEGER},
|
||||
#{auditTime,jdbcType=TIMESTAMP},
|
||||
#{serviceId,jdbcType=INTEGER},
|
||||
#{requestId,jdbcType=INTEGER},
|
||||
#{regionId,jdbcType=INTEGER},
|
||||
#{groupId,jdbcType=INTEGER},
|
||||
#{compileId,jdbcType=INTEGER},
|
||||
#{isAreaEffective,jdbcType=INTEGER},
|
||||
#{classify,jdbcType=VARCHAR},
|
||||
#{attribute,jdbcType=VARCHAR},
|
||||
#{lable,jdbcType=VARCHAR},
|
||||
#{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{ipType,jdbcType=INTEGER},
|
||||
#{srcIpAddress,jdbcType=VARCHAR},
|
||||
#{srcIpPattern,jdbcType=INTEGER},#{destIpPattern,jdbcType=INTEGER},
|
||||
#{srcPortPattern,jdbcType=INTEGER},#{destPortPattern,jdbcType=INTEGER},
|
||||
#{srcPort,jdbcType=VARCHAR},
|
||||
#{protocol,jdbcType=INTEGER},
|
||||
#{protocolId,jdbcType=INTEGER},
|
||||
#{direction,jdbcType=INTEGER},
|
||||
#{destPort,jdbcType=VARCHAR},
|
||||
#{destIpAddress,jdbcType=VARCHAR},
|
||||
#{cfgType,jdbcType=VARCHAR},
|
||||
#{cfgRegionCode,jdbcType=INTEGER},
|
||||
#{userRegion1,jdbcType=VARCHAR},
|
||||
#{userRegion2,jdbcType=VARCHAR},
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
#{userRegion4,jdbcType=VARCHAR},
|
||||
#{userRegion5,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<update id="update" parameterType="com.nis.domain.basics.IpCommCfg" >
|
||||
update ip_comm_cfg
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="cfgDesc != null and cfgDesc != ''" >
|
||||
CFG_DESC = #{cfgDesc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="action != null" >
|
||||
ACTION = #{action,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
IS_VALID = #{isValid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAudit != null" >
|
||||
IS_AUDIT = #{isAudit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="editorId != null" >
|
||||
EDITOR_ID = #{editorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="editTime != null and editTime != ''" >
|
||||
EDIT_TIME = #{editTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="auditorId != null" >
|
||||
AUDITOR_ID = #{auditorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="auditTime != null and auditTime != ''" >
|
||||
AUDIT_TIME = #{auditTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="regionId != null" >
|
||||
REGION_ID = #{regionId,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="requestId != null" >
|
||||
REQUEST_ID = #{requestId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAreaEffective != null" >
|
||||
IS_AREA_EFFECTIVE = #{isAreaEffective,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="classify != null and classify != ''" >
|
||||
CLASSIFY = #{classify,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="attribute != null and attribute != ''" >
|
||||
ATTRIBUTE = #{attribute,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="lable != null and lable != ''" >
|
||||
LABLE = #{lable,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null" >
|
||||
AREA_EFFECTIVE_IDS = #{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="functionId != null" >
|
||||
FUNCTION_ID = #{functionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="serviceId != null" >
|
||||
SERVICE_ID = #{serviceId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="ipType != null" >
|
||||
IP_TYPE = #{ipType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcIpAddress != null and srcIpAddress != ''" >
|
||||
SRC_IP_ADDRESS = #{srcIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="srcIpPattern != null" >
|
||||
SRC_IP_PATTERN = #{srcIpPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destIpPattern != null" >
|
||||
DEST_IP_PATTERN =#{destIpPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPortPattern != null" >
|
||||
SRC_PORT_PATTERN = #{srcPortPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destPortPattern != null" >
|
||||
DEST_PORT_PATTERN = #{destPortPattern,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="srcPort != null and srcPort != ''" >
|
||||
SRC_PORT = #{srcPort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="protocol != null" >
|
||||
PROTOCOL = #{protocol,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="protocolId != null" >
|
||||
PROTOCOL_ID = #{protocolId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="direction != null" >
|
||||
DIRECTION = #{direction,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="destPort != null and destPort != ''" >
|
||||
DEST_PORT = #{destPort,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="destIpAddress != null and destIpAddress != ''" >
|
||||
DEST_IP_ADDRESS = #{destIpAddress,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''" >
|
||||
CFG_TYPE = #{cfgType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="cfgRegionCode != null " >
|
||||
CFG_REGION_CODE = #{cfgRegionCode,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="userRegion1 != null and userRegion1 != ''" >
|
||||
USER_REGION1 = #{userRegion1,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion2 != null and userRegion2 != ''" >
|
||||
USER_REGION2 = #{userRegion2,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion3 != null and userRegion3 != ''" >
|
||||
USER_REGION3 = #{userRegion3,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion4 != null and userRegion4 != ''" >
|
||||
USER_REGION4 = #{userRegion4,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion5 != null and userRegion5 != ''" >
|
||||
USER_REGION5 = #{userRegion5,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="groupId != null and groupId != ''" >
|
||||
GROUP_ID = #{groupId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="regionId != null and regionId != ''" >
|
||||
REGION_ID = #{regionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
and cfg_id = #{cfgId,jdbcType=INTEGER}
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<delete id="delete" parameterType="java.lang.String" >
|
||||
delete from ip_comm_cfg where cfg_id in (${ids})
|
||||
</delete>
|
||||
<select id="getGroupIdCount" parameterType="java.lang.Integer" resultType="java.lang.Integer">
|
||||
SELECT COUNT(cfg_id) groupCount from ip_comm_cfg
|
||||
WHERE group_id= #{groupId}
|
||||
and is_valid=1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -24,6 +24,9 @@ public interface PolicyGroupInfoDao extends CrudDao<PolicyGroupInfo> {
|
||||
|
||||
Integer getGroupIdByGroupName(String groupName);
|
||||
PolicyGroupInfo getGroupInfo(PolicyGroupInfo policyGroupInfo);
|
||||
|
||||
List<PolicyGroupInfo> findPolicyGroupInfosByTypeForUD(@Param("groupType")Integer groupType,@Param("flag")Integer flag);
|
||||
List<PolicyGroupInfo> findLimitedPolicyGroupInfosByTypeForUD(@Param("groupType")Integer groupType,@Param("flag")Integer flag,@Param("limit")Integer limit);
|
||||
List<PolicyGroupInfo> findPolicyByGroupInfoList(@Param("ids")String ids);
|
||||
void updateUdFlag(@Param("groupId")int groupId,@Param("udFlag")int udFlag,@Param("groupType")int groupType);
|
||||
List<PolicyGroupInfo> findPolicyByServiceGroupInfoList(@Param("ids")String ids);
|
||||
}
|
||||
@@ -266,6 +266,45 @@
|
||||
WHERE
|
||||
r.group_id IN (${ids})
|
||||
</select>
|
||||
|
||||
<select id="findPolicyByServiceGroupInfoList" resultMap="PolicyGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
<trim prefix="," prefixOverrides=",">
|
||||
, s.name as creator_name
|
||||
,e.name as editor_name
|
||||
</trim>
|
||||
FROM
|
||||
policy_group_info r
|
||||
left join sys_user s on r.creator_id=s.id
|
||||
left join sys_user e on r.editor_id=e.id
|
||||
WHERE
|
||||
r.service_group_id IN (${ids})
|
||||
</select>
|
||||
<select id="findPolicyGroupInfosByTypeForUD" resultMap="PolicyGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM policy_group_info r
|
||||
where r.is_valid=1 and r.group_type=#{groupType,jdbcType=INTEGER}
|
||||
<if test="flag!=null">
|
||||
and ud_flag=#{flag}
|
||||
</if>
|
||||
</select>
|
||||
<select id="findLimitedPolicyGroupInfosByTypeForUD" resultMap="PolicyGroupInfoMap">
|
||||
SELECT
|
||||
<include refid="PolicyGroupInfoColumns"/>
|
||||
FROM policy_group_info r
|
||||
where r.is_valid=1 and r.group_type=#{groupType,jdbcType=INTEGER}
|
||||
<if test="flag!=null">
|
||||
and ud_flag=#{flag}
|
||||
</if>
|
||||
<if test="flag!=null">
|
||||
limit #{limit}
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateUdFlag" parameterType="java.lang.Integer">
|
||||
UPDATE policy_group_info SET ud_flag =#{udFlag}
|
||||
WHERE service_group_id=#{groupId}
|
||||
and group_type=#{groupType}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
38
src/main/java/com/nis/web/dao/basics/UrlCommGroupDao.java
Normal file
38
src/main/java/com/nis/web/dao/basics/UrlCommGroupDao.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.nis.web.dao.basics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.nis.domain.basics.UrlCommCfg;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.MyBatisDao;
|
||||
|
||||
@MyBatisDao
|
||||
public interface UrlCommGroupDao extends CrudDao<UrlCommCfg>{
|
||||
|
||||
// 查询列表
|
||||
public List<UrlCommCfg> findAllPageList(UrlCommCfg entity);
|
||||
|
||||
public List<UrlCommCfg> findByPage(@Param("ids")String ids);
|
||||
|
||||
public List<UrlCommCfg> findInfoByCfgId(@Param("cfgId")Long cfgId);
|
||||
//新增
|
||||
public int insertUrlCommGroupCfg(UrlCommCfg entity);
|
||||
|
||||
public Integer findUrlUdFlag(@Param("groupId")Integer groupId);
|
||||
|
||||
public int updateUrlUdFlag(@Param("groupId")Integer groupId,@Param("udFlag")Integer udFlag);
|
||||
|
||||
//修改
|
||||
public int update(UrlCommCfg entity);
|
||||
|
||||
//删除
|
||||
public int delete(@Param("ids")String ids);
|
||||
|
||||
public List<UrlCommCfg> getByIds(@Param("ids")String ids);
|
||||
|
||||
|
||||
public Integer getGroupIdCount(@Param("groupId")String groupId);
|
||||
|
||||
}
|
||||
388
src/main/java/com/nis/web/dao/basics/UrlCommGroupDao.xml
Normal file
388
src/main/java/com/nis/web/dao/basics/UrlCommGroupDao.xml
Normal file
@@ -0,0 +1,388 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
||||
<mapper namespace="com.nis.web.dao.basics.UrlCommGroupDao">
|
||||
<resultMap id="urlCommGroupCfgMap" type="com.nis.domain.basics.UrlCommCfg">
|
||||
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
|
||||
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
|
||||
<result column="cfg_keywords" property="cfgKeywords" jdbcType="VARCHAR" />
|
||||
<result column="action" property="action" jdbcType="INTEGER" />
|
||||
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
|
||||
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
|
||||
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
|
||||
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
|
||||
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
|
||||
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
|
||||
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
|
||||
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
|
||||
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
|
||||
<result column="request_id" property="requestId" jdbcType="INTEGER" />
|
||||
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
|
||||
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
|
||||
<result column="classify" property="classify" jdbcType="VARCHAR" />
|
||||
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
|
||||
<result column="lable" property="lable" jdbcType="VARCHAR" />
|
||||
<result column="expr_type" property="exprType" jdbcType="INTEGER" />
|
||||
<result column="match_method" property="matchMethod" jdbcType="INTEGER" />
|
||||
<result column="is_hexbin" property="isHexbin" jdbcType="INTEGER" />
|
||||
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
|
||||
<result column="function_id" property="functionId" jdbcType="INTEGER" />
|
||||
<result column="cfg_region_code" property="cfgRegionCode" jdbcType="INTEGER" />
|
||||
<result column="cfg_type" property="cfgType" jdbcType="VARCHAR" />
|
||||
<result column="ratelimit" property="ratelimit" jdbcType="VARCHAR" />
|
||||
<result column="user_region1" property="userRegion1" jdbcType="VARCHAR" />
|
||||
<result column="user_region2" property="userRegion2" jdbcType="VARCHAR" />
|
||||
<result column="user_region3" property="userRegion3" jdbcType="VARCHAR" />
|
||||
<result column="user_region4" property="userRegion4" jdbcType="VARCHAR" />
|
||||
<result column="user_region5" property="userRegion5" jdbcType="VARCHAR" />
|
||||
|
||||
<result column="group_name" property="groupName" jdbcType="VARCHAR" />
|
||||
</resultMap>
|
||||
|
||||
<select id="findAllPageList" parameterType="com.nis.domain.basics.UrlCommCfg" resultMap="urlCommGroupCfgMap">
|
||||
SELECT
|
||||
r.cfg_id,r.cfg_desc,r.cfg_keywords,r.action,r.is_valid,r.is_audit,r.creator_id,
|
||||
r.create_time,r.editor_id,r.edit_time,r.auditor_id,r.audit_time,r.service_id,
|
||||
r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,
|
||||
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,
|
||||
r.cfg_region_code,r.cfg_type,r.ratelimit,r.user_region1,r.user_region2,
|
||||
r.user_region3,r.user_region4,r.user_region5,
|
||||
s.name AS creator_name,e.name AS editor_name,u.name AS auditor_name,c.group_name
|
||||
FROM
|
||||
http_url_cfg r
|
||||
LEFT JOIN sys_user s ON r.creator_id = s.id
|
||||
LEFT JOIN sys_user e ON r.editor_id = e.id
|
||||
LEFT JOIN sys_user u ON r.auditor_id = u.id
|
||||
LEFT JOIN policy_group_info c ON c.service_group_id=r.user_region3
|
||||
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||
<if test="page !=null and page.where != null and page.where != ''">
|
||||
AND ${page.where}
|
||||
</if>
|
||||
<if test="cfgId != null">
|
||||
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
|
||||
</if>
|
||||
<if test="cfgDesc != null and cfgDesc != ''">
|
||||
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgKeywords != null and cfgKeywords != ''">
|
||||
AND r.cfg_keywords like concat(concat('%',#{cfgKeywords,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="cfgRegionCode != null">
|
||||
AND r.CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''">
|
||||
AND r.CFG_TYPE like concat(concat('%',#{cfgType,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="action != null">
|
||||
AND r.ACTION=#{action,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid != null">
|
||||
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isValid == null">
|
||||
AND r.IS_VALID != -1
|
||||
</if>
|
||||
<if test="isAudit != null">
|
||||
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="creatorName != null and creatorName !=''">
|
||||
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="createTime != null and createTime !=''">
|
||||
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="editorName != null and editorName !=''">
|
||||
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="editTime != null and editTime !='' ">
|
||||
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="auditorName != null and auditorName !=''">
|
||||
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="auditTime != null and auditTime !=''">
|
||||
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
|
||||
</if>
|
||||
<if test="serviceId != null">
|
||||
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="requestId != null">
|
||||
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="isAreaEffective != null">
|
||||
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
|
||||
</if>
|
||||
<if test="classify != null and classify !=''">
|
||||
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="attribute != null and attribute !=''">
|
||||
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="lable != null and lable !=''">
|
||||
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null and areaEffectiveIds !=''">
|
||||
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
|
||||
</if>
|
||||
<if test="functionId != null">
|
||||
AND r.FUNCTION_ID=#{functionId,jdbcType=INTEGER}
|
||||
</if>
|
||||
|
||||
<!-- 数据范围过滤 -->
|
||||
${sqlMap.dsf}
|
||||
</trim>
|
||||
<choose>
|
||||
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
|
||||
ORDER BY ${page.orderBy}
|
||||
</when>
|
||||
<otherwise>
|
||||
ORDER BY r.is_audit,r.create_time desc
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<select id="findByPage" resultMap="urlCommGroupCfgMap">
|
||||
SELECT
|
||||
r.cfg_id,r.cfg_desc,r.cfg_keywords,r.action,r.is_valid,r.is_audit,r.creator_id,
|
||||
r.create_time,r.editor_id,r.edit_time,r.auditor_id,r.audit_time,r.service_id,
|
||||
r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,
|
||||
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,
|
||||
r.cfg_region_code,r.cfg_type,r.ratelimit,r.user_region1,r.user_region2,
|
||||
r.user_region3,r.user_region4,r.user_region5,
|
||||
s.name AS creator_name,e.name AS editor_name,u.name AS auditor_name
|
||||
FROM
|
||||
http_url_cfg r
|
||||
LEFT JOIN sys_user s ON r.creator_id = s.id
|
||||
LEFT JOIN sys_user e ON r.editor_id = e.id
|
||||
LEFT JOIN sys_user u ON r.auditor_id = u.id
|
||||
where r.CFG_ID in (${ids})
|
||||
</select>
|
||||
|
||||
<select id="findInfoByCfgId" resultMap="urlCommGroupCfgMap">
|
||||
SELECT
|
||||
r.cfg_id,r.cfg_desc,r.cfg_keywords,r.action,r.is_valid,r.is_audit,r.creator_id,
|
||||
r.create_time,r.editor_id,r.edit_time,r.auditor_id,r.audit_time,r.service_id,
|
||||
r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,
|
||||
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,
|
||||
r.cfg_region_code,r.cfg_type,r.ratelimit,r.user_region1,r.user_region2,
|
||||
r.user_region3,r.user_region4,r.user_region5
|
||||
FROM
|
||||
http_url_cfg r
|
||||
where r.CFG_ID =#{cfgId}
|
||||
|
||||
</select>
|
||||
|
||||
<select id="get" resultMap="urlCommGroupCfgMap">
|
||||
SELECT
|
||||
r.cfg_id,r.cfg_desc,r.cfg_keywords,r.action,r.is_valid,r.is_audit,r.creator_id,
|
||||
r.create_time,r.editor_id,r.edit_time,r.auditor_id,r.audit_time,r.service_id,
|
||||
r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,
|
||||
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,
|
||||
r.cfg_region_code,r.cfg_type,r.ratelimit,r.user_region1,r.user_region2,
|
||||
r.user_region3,r.user_region4,r.user_region5
|
||||
from http_url_cfg r
|
||||
where r.cfg_id=#{cfgId}
|
||||
</select>
|
||||
|
||||
<insert id="insertUrlCommGroupCfg" parameterType="com.nis.domain.basics.UrlCommCfg">
|
||||
insert into http_url_cfg (
|
||||
CFG_DESC,
|
||||
cfg_keywords,
|
||||
action,
|
||||
is_valid,
|
||||
is_audit,
|
||||
creator_id,
|
||||
create_time,
|
||||
editor_id,
|
||||
edit_time,
|
||||
auditor_id,
|
||||
audit_time,
|
||||
service_id,
|
||||
request_id,
|
||||
compile_id,
|
||||
IS_AREA_EFFECTIVE,
|
||||
CLASSIFY,
|
||||
ATTRIBUTE,
|
||||
LABLE,
|
||||
expr_type,
|
||||
match_method,
|
||||
is_hexbin,
|
||||
area_effective_ids,
|
||||
function_id,
|
||||
cfg_region_code,
|
||||
cfg_type,
|
||||
ratelimit,
|
||||
user_region1,
|
||||
user_region2,
|
||||
user_region3,
|
||||
user_region4,
|
||||
user_region5
|
||||
)values (
|
||||
#{cfgDesc,jdbcType=VARCHAR},
|
||||
#{cfgKeywords,jdbcType=VARCHAR},
|
||||
#{action,jdbcType=INTEGER},
|
||||
#{isValid,jdbcType=INTEGER},
|
||||
#{isAudit,jdbcType=INTEGER},
|
||||
#{creatorId,jdbcType=INTEGER},
|
||||
#{createTime,jdbcType=TIMESTAMP},
|
||||
#{editorId,jdbcType=INTEGER},
|
||||
#{editTime,jdbcType=TIMESTAMP},
|
||||
#{auditorId,jdbcType=INTEGER},
|
||||
#{auditTime,jdbcType=TIMESTAMP},
|
||||
#{serviceId,jdbcType=INTEGER},
|
||||
#{requestId,jdbcType=INTEGER},
|
||||
#{compileId,jdbcType=INTEGER},
|
||||
#{isAreaEffective,jdbcType=INTEGER},
|
||||
#{classify,jdbcType=VARCHAR},
|
||||
#{attribute,jdbcType=VARCHAR},
|
||||
#{lable,jdbcType=VARCHAR},
|
||||
#{exprType,jdbcType=INTEGER},
|
||||
#{matchMethod,jdbcType=INTEGER},
|
||||
#{isHexbin,jdbcType=INTEGER},
|
||||
#{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
#{functionId,jdbcType=INTEGER},
|
||||
#{cfgRegionCode,jdbcType=INTEGER},
|
||||
#{cfgType,jdbcType=VARCHAR},
|
||||
#{ratelimit,jdbcType=VARCHAR},
|
||||
#{userRegion1,jdbcType=VARCHAR},
|
||||
#{userRegion2,jdbcType=VARCHAR},
|
||||
#{userRegion3,jdbcType=VARCHAR},
|
||||
#{userRegion4,jdbcType=VARCHAR},
|
||||
#{userRegion5,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<select id="findUrlUdFlag" parameterType="java.lang.Integer" resultType="java.lang.Integer">
|
||||
SELECT ud_flag from policy_group_info
|
||||
where service_group_id=#{groupId}
|
||||
and group_type=11
|
||||
</select>
|
||||
|
||||
<update id="updateUrlUdFlag" parameterType="java.lang.Integer">
|
||||
UPDATE policy_group_info SET ud_flag =#{udFlag}
|
||||
WHERE service_group_id=#{groupId}
|
||||
and group_type=11
|
||||
</update>
|
||||
|
||||
<update id="update" parameterType="com.nis.domain.basics.UrlCommCfg" >
|
||||
update http_url_cfg
|
||||
<set >
|
||||
<trim suffixOverrides=",">
|
||||
<if test="cfgDesc != null and cfgDesc != ''" >
|
||||
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="cfgKeywords != null and cfgKeywords != ''" >
|
||||
cfg_keywords = #{cfgKeywords,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="action != null" >
|
||||
action = #{action,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isValid != null" >
|
||||
is_valid = #{isValid,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAudit != null" >
|
||||
is_audit = #{isAudit,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="editorId != null" >
|
||||
editor_id = #{editorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="editTime != null and editTime != ''" >
|
||||
edit_time = #{editTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="auditorId != null" >
|
||||
AUDITOR_ID = #{auditorId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="auditTime != null and auditTime != ''" >
|
||||
AUDIT_TIME = #{auditTime,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="serviceId != null" >
|
||||
service_id = #{serviceId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="requestId != null" >
|
||||
request_id = #{requestId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="compileId != null and compileId != ''" >
|
||||
compile_id = #{compileId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isAreaEffective != null" >
|
||||
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="classify != null and classify != ''" >
|
||||
classify = #{classify,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="attribute != null and attribute != ''" >
|
||||
attribute = #{attribute,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="lable != null and lable != ''" >
|
||||
lable = #{lable,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="exprType != null" >
|
||||
expr_type = #{exprType,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="matchMethod != null" >
|
||||
match_method = #{matchMethod,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="isHexbin != null" >
|
||||
is_hexbin = #{isHexbin,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="areaEffectiveIds != null" >
|
||||
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="functionId != null" >
|
||||
function_id = #{functionId,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="cfgType != null and cfgType != ''" >
|
||||
cfg_type = #{cfgType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="cfgRegionCode != null " >
|
||||
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="ratelimit != null and ratelimit != ''" >
|
||||
ratelimit = #{ratelimit,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion1 != null and userRegion1 != ''" >
|
||||
user_region1 = #{userRegion1,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion2 != null and userRegion2 != ''" >
|
||||
user_region2 = #{userRegion2,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion3 != null and userRegion3 != ''" >
|
||||
user_region3 = #{userRegion3,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion4 != null and userRegion4 != ''" >
|
||||
user_region4 = #{userRegion4,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="userRegion5 != null and userRegion5 != ''" >
|
||||
user_region5 = #{userRegion5,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</set>
|
||||
<where>
|
||||
and cfg_id = #{cfgId,jdbcType=INTEGER}
|
||||
</where>
|
||||
</update>
|
||||
|
||||
<delete id="delete" parameterType="java.lang.String" >
|
||||
delete from http_url_cfg where cfg_id in (${ids})
|
||||
</delete>
|
||||
|
||||
<select id="getByIds" resultMap="urlCommGroupCfgMap">
|
||||
select
|
||||
r.cfg_id,r.cfg_desc,r.cfg_keywords,r.action,r.is_valid,r.is_audit,r.creator_id,
|
||||
r.create_time,r.editor_id,r.edit_time,r.auditor_id,r.audit_time,r.service_id,
|
||||
r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,
|
||||
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,
|
||||
r.cfg_region_code,r.cfg_type,r.ratelimit,r.user_region1,r.user_region2,
|
||||
r.user_region3,r.user_region4,r.user_region5
|
||||
from http_url_cfg r
|
||||
where r.cfg_id in (${ids}) and is_valid !=-1
|
||||
</select>
|
||||
|
||||
<select id="getGroupIdCount" parameterType="java.lang.String" resultType="java.lang.Integer">
|
||||
SELECT COUNT(cfg_id) groupCount from http_url_cfg
|
||||
WHERE user_region3= #{groupId}
|
||||
and is_valid=1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -16,6 +16,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringEscapeUtils;
|
||||
import org.apache.ibatis.executor.Executor;
|
||||
import org.apache.ibatis.mapping.MappedStatement;
|
||||
@@ -51,6 +52,8 @@ import com.nis.domain.SysRole;
|
||||
import com.nis.domain.SysUser;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.basics.UrlCommCfg;
|
||||
import com.nis.domain.callback.InlineIp;
|
||||
import com.nis.domain.callback.NtcDnsResStrategy;
|
||||
import com.nis.domain.callback.ProxyObjKeyring;
|
||||
@@ -1449,12 +1452,67 @@ public abstract class BaseService {
|
||||
List<IpCfg> cfgs = ipConvert(cfg, baseIpCfg);
|
||||
maatIpList.addAll(cfgs);
|
||||
}
|
||||
} else if(ipCfgList.get(0) instanceof IpCommCfg) {
|
||||
for (BaseCfg<?> _cfg : ipCfgList) {
|
||||
IpCfg cfg = new IpCfg();
|
||||
BaseIpCfg baseIpCfg = new BaseIpCfg();
|
||||
IpCommCfg ipCommGroupCfg = (IpCommCfg) _cfg;
|
||||
BeanUtils.copyProperties(ipCommGroupCfg, baseIpCfg);
|
||||
BeanUtils.copyProperties(baseIpCfg, cfg);
|
||||
if(groupId==null) {
|
||||
cfg.setGroupId(ipCommGroupCfg.getGroupId());
|
||||
}else {
|
||||
cfg.setGroupId(groupId);
|
||||
}
|
||||
cfg.setRegionId(ipCommGroupCfg.getRegionId());
|
||||
//user regions
|
||||
//String userRegion = "APP_ID=" + appIpCfg.getAppCode();
|
||||
//cfg.setUserRegion(userRegion);
|
||||
cfg.setIsValid(isValid);
|
||||
cfg.setAuditTime(opTime);
|
||||
List<IpCfg> cfgs = ipConvert(cfg, baseIpCfg);
|
||||
maatIpList.addAll(cfgs);
|
||||
}
|
||||
}
|
||||
}
|
||||
long end = System.currentTimeMillis();
|
||||
logger.warn("convert data finish,cost:" + (end - start));
|
||||
return maatIpList;
|
||||
}
|
||||
public List<StringCfg> groupReuseStringCfgAddRemoveConvert(List<? extends BaseCfg<?>> stringCfgList, Integer isValid,
|
||||
Integer groupId) {
|
||||
logger.warn("convert data start");
|
||||
long start = System.currentTimeMillis();
|
||||
Date opTime = new Date();
|
||||
List<StringCfg> maatStringList = new ArrayList<>();
|
||||
if (CollectionUtils.isNotEmpty(stringCfgList)) {
|
||||
// 只用一次instanceof,取代循环中每次都用一次instanceof
|
||||
if(stringCfgList.get(0) instanceof UrlCommCfg) {
|
||||
for (BaseCfg<?> _cfg : stringCfgList) {
|
||||
StringCfg cfg = new StringCfg();
|
||||
BaseStringCfg baseStringCfg = new BaseStringCfg();
|
||||
UrlCommCfg ipCommGroupCfg = (UrlCommCfg) _cfg;
|
||||
BeanUtils.copyProperties(_cfg, baseStringCfg);
|
||||
BeanUtils.copyProperties(baseStringCfg, cfg);
|
||||
if(groupId==null) {
|
||||
cfg.setGroupId(ipCommGroupCfg.getGroupId());
|
||||
}else {
|
||||
cfg.setGroupId(groupId);
|
||||
}
|
||||
cfg.setRegionId(ipCommGroupCfg.getRegionId());
|
||||
//user regions
|
||||
//String userRegion = "APP_ID=" + appIpCfg.getAppCode();
|
||||
//cfg.setUserRegion(userRegion);
|
||||
cfg.setIsValid(isValid);
|
||||
cfg.setAuditTime(opTime);
|
||||
maatStringList.add(cfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
long end = System.currentTimeMillis();
|
||||
logger.warn("convert data finish,cost:" + (end - start));
|
||||
return maatStringList;
|
||||
}
|
||||
public MaatCfg convertMaatCfg(BaseCfg _cfg,Integer cfgType) {
|
||||
MaatCfg maatCfg = new MaatCfg();
|
||||
maatCfg.initDefaultValue();
|
||||
|
||||
@@ -0,0 +1,250 @@
|
||||
package com.nis.web.service.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.beust.jcommander.internal.Maps;
|
||||
import com.beust.jcommander.internal.Sets;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.nis.domain.FunctionRegionDict;
|
||||
import com.nis.domain.FunctionServiceDict;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.IpCommCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.maat.GroupReuseAddBean;
|
||||
import com.nis.domain.maat.GroupReuseCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.basics.AsnGroupInfoDao;
|
||||
import com.nis.web.dao.basics.AsnIpCfgDao;
|
||||
import com.nis.web.dao.basics.IpCommGroupCfgDao;
|
||||
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.BaseService;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
@Service
|
||||
public class IpCommGroupCfgService extends BaseService {
|
||||
@Autowired
|
||||
private IpCommGroupCfgDao ipCommGroupCfgDao;
|
||||
@Autowired
|
||||
private PolicyGroupInfoDao policyGroupInfoDao;
|
||||
/**
|
||||
* @param page
|
||||
* @param entity
|
||||
* @return
|
||||
*/
|
||||
public Page<IpCommCfg> findPage(Page<IpCommCfg> page, IpCommCfg entity) {
|
||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
|
||||
entity.setPage(page);
|
||||
List<IpCommCfg> list=ipCommGroupCfgDao.findPage(entity);
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
public List<IpCommCfg> findByPage(String ids) {
|
||||
List<IpCommCfg> list=ipCommGroupCfgDao.findByPage(ids);
|
||||
return list;
|
||||
}
|
||||
|
||||
public IpCommCfg get(Long id ) {
|
||||
return ipCommGroupCfgDao.get(id);
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void save(List<IpCommCfg> entitys) {
|
||||
logger.warn("Start to save IP,size:"+entitys.size());
|
||||
long start=System.currentTimeMillis();
|
||||
for(IpCommCfg ipCfg:entitys) {
|
||||
ipCommGroupCfgDao.insert(ipCfg);
|
||||
}
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("Save IP finish,cost:"+(end-start));
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void update(IpCommCfg entity){
|
||||
ipCommGroupCfgDao.update(entity);
|
||||
}
|
||||
|
||||
|
||||
public List<IpCommCfg> getByIds(String ids) {
|
||||
if(ids==null) {
|
||||
throw new RuntimeException("ids is null!");
|
||||
}
|
||||
return ipCommGroupCfgDao.getByIds(ids);
|
||||
}
|
||||
|
||||
//新增
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveIpCommGroupCfg(CfgIndexInfo entity) {
|
||||
Date createTime=new Date();
|
||||
if(CollectionUtils.isNotEmpty(entity.getIpCommGroupCfgList())) {
|
||||
for (int i = 0; i < entity.getIpCommGroupCfgList().size(); i++) {
|
||||
BeanUtils.copyProperties(entity, entity.getIpCommGroupCfgList().get(i), new String[]{"cfgId","userregion3"});
|
||||
entity.getIpCommGroupCfgList().get(i).setRequestId(0);
|
||||
entity.getIpCommGroupCfgList().get(i).setClassify("0");
|
||||
entity.getIpCommGroupCfgList().get(i).setAttribute("0");
|
||||
entity.getIpCommGroupCfgList().get(i).setLable("0");
|
||||
entity.getIpCommGroupCfgList().get(i).setCreateTime(createTime);
|
||||
entity.getIpCommGroupCfgList().get(i).setCreatorId(entity.getCurrentUser().getId());
|
||||
entity.getIpCommGroupCfgList().get(i).setIsValid(Constants.VALID_NO);
|
||||
entity.getIpCommGroupCfgList().get(i).setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
entity.getIpCommGroupCfgList().get(i).setGroupId(Integer.parseInt(entity.getUserRegion3()));
|
||||
ipCommGroupCfgDao.insertForBatch(entity.getIpCommGroupCfgList().get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void audit(List<IpCommCfg> ipCommGroupCfgs, Integer isAudit, Integer isValid) {
|
||||
// TODO Auto-generated method stub
|
||||
Set<Integer> groupIds=Sets.newHashSet();
|
||||
if(!StringUtil.isEmpty(ipCommGroupCfgs)){
|
||||
for(IpCommCfg cfg:ipCommGroupCfgs) {
|
||||
cfg.setIsValid(isValid);
|
||||
cfg.setIsAudit(isAudit);
|
||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||
cfg.setAuditTime(new Date());
|
||||
groupIds.add(cfg.getGroupId());
|
||||
ipCommGroupCfgDao.update(cfg);
|
||||
}
|
||||
}
|
||||
//查询有效的Ip配置个数
|
||||
for(Integer groupId:groupIds) {
|
||||
Integer groupCount=ipCommGroupCfgDao.getGroupIdCount(groupId);
|
||||
if(groupCount>0){//udFlag 设置为1
|
||||
policyGroupInfoDao.updateUdFlag(groupId, 1,5);
|
||||
}else{//udFlag 设置为0
|
||||
policyGroupInfoDao.updateUdFlag(groupId, 0,5);
|
||||
}
|
||||
}
|
||||
//下发配置时改变公共组udFlag标识
|
||||
send2Maat(ipCommGroupCfgs,isValid);
|
||||
}
|
||||
public void send2Maat(List<IpCommCfg> ipCommGroupCfgs,int isValid) {
|
||||
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||
List<IpCfg> ipRegionList = groupReuseCfgAddRemoveConvert(ipCommGroupCfgs,isValid,null);
|
||||
List<StringCfg> strRegionList = new ArrayList<>();
|
||||
List<NumBoundaryCfg> numRegionList = new ArrayList<>();
|
||||
groupReuseCfg.setIpRegionList(ipRegionList);
|
||||
groupReuseCfg.setStrRegionList(strRegionList);
|
||||
groupReuseCfg.setNumRegionList(numRegionList);
|
||||
groupReuseList.add(groupReuseCfg);
|
||||
maatBean.setGroupReuseCfgList(groupReuseList);
|
||||
maatBean.setAuditTime(new Date());
|
||||
maatBean.setCreatorName(UserUtils.getUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
logger.warn("IP Common Region Send To Maat start");
|
||||
long start=System.currentTimeMillis();
|
||||
if(isValid==Constants.VALID_YES) {
|
||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
if(ipCommGroupCfgs.size()<=100) {
|
||||
logger.info("ip 公共组域新增配置下发配置参数:"+json);
|
||||
}else {
|
||||
logger.info("ip 公共组域新增配置下发region条数:"+ipCommGroupCfgs.size());
|
||||
}
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result =ConfigServiceUtil.postGroupReuseSources(json);
|
||||
logger.info("ip 公共组域新增配置响应信息:"+result.getMsg());
|
||||
}else {
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
if(ipCommGroupCfgs.size()<=100) {
|
||||
logger.info("ip 公共组域删除配置下发配置参数:"+json);
|
||||
}else {
|
||||
logger.info("ip 公共组域删除配置下发region条数:"+ipCommGroupCfgs.size());
|
||||
|
||||
}
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,3);
|
||||
logger.info("asn ip复用域删除配置响应信息:"+result.getMsg());
|
||||
}
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("IP Common Region Send To Maat finish,cost:"+(end-start));
|
||||
}
|
||||
public void delete(String ids) {
|
||||
// TODO Auto-generated method stub
|
||||
if(ids==null) {
|
||||
throw new RuntimeException("ids is null!");
|
||||
}
|
||||
ipCommGroupCfgDao.delete(ids);
|
||||
}
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveAndSend(FunctionRegionDict regionDict, FunctionServiceDict serviceDict, List<BaseIpCfg> cfgs,
|
||||
boolean send) {
|
||||
// TODO Auto-generated method stub
|
||||
logger.warn("Start to save IP,size:"+cfgs.size());
|
||||
long start=System.currentTimeMillis();
|
||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||
SqlSession batchSqlSession = null;
|
||||
//需要通过新增域接口新增的ip集合
|
||||
Map<Integer,Integer> groupCount=Maps.newHashMap();
|
||||
// AsnCacheUtils.init(true);
|
||||
List<IpCommCfg> ipCommCfgs=new ArrayList(cfgs.size());
|
||||
try{
|
||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||
|
||||
for(BaseIpCfg cfg:cfgs) {
|
||||
IpCommCfg ipCommCfg=new IpCommCfg();
|
||||
BeanUtils.copyProperties(cfg, ipCommCfg);
|
||||
ipCommCfgs.add(ipCommCfg);
|
||||
((IpCommGroupCfgDao) batchSqlSession.getMapper(IpCommGroupCfgDao.class)).insertForBatch(ipCommCfg);
|
||||
if(send) {
|
||||
if(groupCount.containsKey(ipCommCfg.getGroupId())) {
|
||||
groupCount.put(ipCommCfg.getGroupId(), groupCount.get(ipCommCfg.getGroupId())+1);
|
||||
}else {
|
||||
groupCount.put(ipCommCfg.getGroupId(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if(send) {
|
||||
if(groupCount.size()>0) {
|
||||
for(Entry<Integer, Integer> groupId:groupCount.entrySet()) {
|
||||
policyGroupInfoDao.updateUdFlag(groupId.getKey(), 1,5);
|
||||
}
|
||||
|
||||
this.send2Maat(ipCommCfgs, Constants.VALID_YES);
|
||||
}
|
||||
}
|
||||
batchSqlSession.commit();
|
||||
}finally {
|
||||
if(batchSqlSession != null){
|
||||
batchSqlSession.close();
|
||||
}
|
||||
}
|
||||
long end=System.currentTimeMillis();
|
||||
logger.warn("Save IP finish,cost:"+(end-start));
|
||||
cfgs.clear();
|
||||
cfgs=null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -47,6 +47,10 @@ public class PolicyGroupInfoService extends BaseService{
|
||||
List<PolicyGroupInfo> list=policyGroupInfoDao.findPolicyByGroupInfoList(ids);
|
||||
return list;
|
||||
}
|
||||
public List<PolicyGroupInfo> findPolicyByServiceGroupInfoList(String ids) {
|
||||
List<PolicyGroupInfo> list=policyGroupInfoDao.findPolicyByServiceGroupInfoList(ids);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
public List<PolicyGroupInfo> findPolicyGroupInfos() {
|
||||
@@ -84,7 +88,7 @@ public class PolicyGroupInfoService extends BaseService{
|
||||
entity.setCreatorId(UserUtils.getUser().getId());
|
||||
entity.setCreateTime(createTime);
|
||||
//asn类型从综合服务获取groupId
|
||||
if(4==entity.getGroupType().intValue()) {
|
||||
if(4==entity.getGroupType().intValue()||5==entity.getGroupType().intValue()||6==entity.getGroupType().intValue()||7==entity.getGroupType().intValue()) {
|
||||
int serviceGroupId=0;
|
||||
List<Integer> groupIds= ConfigServiceUtil.getId(2,1);
|
||||
if(groupIds.size()>0) {
|
||||
@@ -173,5 +177,15 @@ public class PolicyGroupInfoService extends BaseService{
|
||||
public PolicyGroupInfo getGroupInfo(PolicyGroupInfo policyGroupInfo){
|
||||
return policyGroupInfoDao.getGroupInfo(policyGroupInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 公共组相关功能使用
|
||||
*/
|
||||
public List<PolicyGroupInfo> findPolicyGroupInfosByTypeforUD(Integer type,Integer flag) {
|
||||
List<PolicyGroupInfo> list=policyGroupInfoDao.findPolicyGroupInfosByTypeForUD(type,flag);
|
||||
return list;
|
||||
}
|
||||
public List<PolicyGroupInfo> findPolicyGroupInfosByTypeforUD(Integer type,Integer flag,Integer limit) {
|
||||
List<PolicyGroupInfo> list=policyGroupInfoDao.findLimitedPolicyGroupInfosByTypeForUD(type,flag,limit);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
package com.nis.web.service.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.session.ExecutorType;
|
||||
import org.apache.ibatis.session.SqlSession;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.basics.AsnGroupInfo;
|
||||
import com.nis.domain.basics.AsnIpCfg;
|
||||
import com.nis.domain.basics.UrlCommCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.maat.GroupReuseAddBean;
|
||||
import com.nis.domain.maat.GroupReuseCfg;
|
||||
import com.nis.domain.maat.MaatCfg;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.dao.CrudDao;
|
||||
import com.nis.web.dao.basics.UrlCommGroupDao;
|
||||
import com.nis.web.dao.configuration.IpCfgDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.CrudService;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
|
||||
@Service
|
||||
public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCommCfg>{
|
||||
|
||||
@Autowired
|
||||
private UrlCommGroupDao urlCommGroupDao;
|
||||
|
||||
|
||||
public Page<UrlCommCfg> findPage(Page<UrlCommCfg> page, UrlCommCfg entity) {
|
||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
|
||||
entity.setPage(page);
|
||||
List<UrlCommCfg> list=urlCommGroupDao.findAllPageList(entity);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
String key=list.get(i).getCfgKeywords().replace("***and***", " ");
|
||||
list.get(i).setCfgKeywords(key);
|
||||
}
|
||||
page.setList(list);
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
public List<UrlCommCfg> findByPage(String ids) {
|
||||
List<UrlCommCfg> list=urlCommGroupDao.findByPage(ids);
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public UrlCommCfg get(Long id ) {
|
||||
return urlCommGroupDao.get(id);
|
||||
}
|
||||
|
||||
//新增 insertUrlCommGroupCfg
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void saveUrlCommGroupCfg(CfgIndexInfo entity) {
|
||||
Date createTime=new Date();
|
||||
if(entity.getUrlCommGroupList()!=null) {
|
||||
for (int i = 0; i < entity.getUrlCommGroupList().size(); i++) {
|
||||
BeanUtils.copyProperties(entity, entity.getUrlCommGroupList().get(i), new String[]{"cfgId"});
|
||||
entity.getUrlCommGroupList().get(i).setRequestId(0);
|
||||
entity.getUrlCommGroupList().get(i).setClassify("0");
|
||||
entity.getUrlCommGroupList().get(i).setAttribute("0");
|
||||
entity.getUrlCommGroupList().get(i).setLable("0");
|
||||
entity.getUrlCommGroupList().get(i).setIsHexbin(0);
|
||||
entity.getUrlCommGroupList().get(i).setCreateTime(createTime);
|
||||
entity.getUrlCommGroupList().get(i).setCreatorId(entity.getCurrentUser().getId());
|
||||
entity.getUrlCommGroupList().get(i).setIsValid(Constants.VALID_NO);
|
||||
entity.getUrlCommGroupList().get(i).setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
if(entity.getUrlCommGroupList().get(i).getCfgKeywords().contains("***and***")){
|
||||
entity.getUrlCommGroupList().get(i).setExprType(1);
|
||||
}else{
|
||||
entity.getUrlCommGroupList().get(i).setExprType(0);
|
||||
}
|
||||
urlCommGroupDao.insertUrlCommGroupCfg(entity.getUrlCommGroupList().get(i));
|
||||
}
|
||||
// //修改公共组的标识
|
||||
// Integer udFlag=urlCommGroupDao.findUrlUdFlag(Integer.parseInt(entity.getUserRegion3()));
|
||||
// if(udFlag == 0){
|
||||
// urlCommGroupDao.updateUrlUdFlag(Integer.parseInt(entity.getUserRegion3()), 1);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void update(UrlCommCfg entity){
|
||||
Date editTime=new Date();
|
||||
entity.setIsValid(0);
|
||||
entity.setIsAudit(0);
|
||||
entity.setEditTime(editTime);
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
if(entity.getCfgKeywords().contains("***and***")){
|
||||
entity.setExprType(1);
|
||||
}else{
|
||||
entity.setExprType(0);
|
||||
}
|
||||
urlCommGroupDao.update(entity);
|
||||
}
|
||||
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void delete(String ids) {
|
||||
|
||||
urlCommGroupDao.delete(ids);
|
||||
}
|
||||
|
||||
public List<UrlCommCfg> getByIds(String ids) {
|
||||
if(ids==null) {
|
||||
throw new RuntimeException("ids is null!");
|
||||
}
|
||||
return urlCommGroupDao.getByIds(ids);
|
||||
}
|
||||
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void audit(UrlCommCfg urlGroupCfg,Integer isAudit,Integer isValid) {
|
||||
|
||||
if(!StringUtil.isEmpty(urlGroupCfg)){
|
||||
urlGroupCfg.setIsValid(isValid);
|
||||
urlGroupCfg.setIsAudit(isAudit);
|
||||
urlGroupCfg.setAuditorId(UserUtils.getUser().getId());
|
||||
urlGroupCfg.setAuditTime(new Date());
|
||||
|
||||
urlCommGroupDao.update(urlGroupCfg);
|
||||
}
|
||||
//下发配置时改变公共组udFlag标识
|
||||
//查询有效的url配置个数
|
||||
Integer groupCount=urlCommGroupDao.getGroupIdCount(urlGroupCfg.getUserRegion3());
|
||||
if(groupCount>0){//udFlag 设置为1
|
||||
urlCommGroupDao.updateUrlUdFlag(Integer.parseInt(urlGroupCfg.getUserRegion3()), 1);
|
||||
}else{//udFlag 设置为0
|
||||
urlCommGroupDao.updateUrlUdFlag(Integer.parseInt(urlGroupCfg.getUserRegion3()), 0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -274,6 +274,73 @@ public class CommonPolicyService extends CrudService<WebsiteCfgDao, CfgIndexInfo
|
||||
}
|
||||
return hasData;
|
||||
}
|
||||
/**
|
||||
* 公共分组通用配置
|
||||
* @param page
|
||||
* @param entity
|
||||
* @param auditMap
|
||||
* @param hasData
|
||||
* @return
|
||||
*/
|
||||
public boolean auditReuseCommonConfigData(
|
||||
Page page,
|
||||
BaseCfg entity,
|
||||
Map<Integer, List> auditMap,
|
||||
boolean hasData){
|
||||
long start=System.currentTimeMillis();
|
||||
long end=System.currentTimeMillis();
|
||||
long totalSize=0;
|
||||
|
||||
if(page.isLastPage()){
|
||||
hasData = false;
|
||||
}
|
||||
List<Integer> regionIds = new ArrayList();
|
||||
for(Entry<Integer, List> e:auditMap.entrySet()) {
|
||||
List<BaseCfg> list=e.getValue();
|
||||
for (BaseCfg baseCfg : list) {
|
||||
regionIds.add(baseCfg.getRegionId());
|
||||
}
|
||||
totalSize=totalSize+list.size();
|
||||
|
||||
}
|
||||
start=System.currentTimeMillis();
|
||||
logger.warn("复用配置批量失效-数据库状态变更:start()");
|
||||
commonPolicyDao.auditCfgBatch( entity.getTableName(), entity,regionIds,null);
|
||||
end=System.currentTimeMillis();
|
||||
logger.warn("复用配置批量失效-数据库状态变更:end("+(end-start)+")");
|
||||
|
||||
//已经下发过的,调用分组复用配置删除接口
|
||||
if(!auditMap.isEmpty()) {
|
||||
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||
List<IpCfg> ipRegionList=new ArrayList<>();
|
||||
for (Integer groupId : auditMap.keySet()) {
|
||||
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(auditMap.get(groupId),Constants.VALID_NO,groupId));
|
||||
}
|
||||
groupReuseCfg.setIpRegionList(ipRegionList);
|
||||
groupReuseCfg.setStrRegionList(null);
|
||||
groupReuseCfg.setNumRegionList(null);
|
||||
groupReuseList.add(groupReuseCfg);
|
||||
maatBean.setGroupReuseCfgList(groupReuseList);
|
||||
maatBean.setAuditTime(new Date());
|
||||
maatBean.setCreatorName(UserUtils.getUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.warn("复用域配置批量取消("+page.getPageNo()+"次):"+ipRegionList.size());
|
||||
//logger.info("app协议IP域配置批量取消:"+json);
|
||||
//调用服务接口下发配置
|
||||
logger.warn("复用配置批量失效-下发:start()");
|
||||
start=System.currentTimeMillis();
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,3);
|
||||
end=System.currentTimeMillis();
|
||||
logger.warn("复用域配置批量取消响应信息:"+result.getMsg());
|
||||
logger.warn("复用配置批量失效-下发:end("+(end-start)+")");
|
||||
}
|
||||
return hasData;
|
||||
}
|
||||
/**
|
||||
* 回调类配置下发
|
||||
* @param className
|
||||
|
||||
@@ -421,6 +421,7 @@
|
||||
<service id="400" functionId="600" serviceType="1" cfgType="1" tableName="asn_ip_cfg" className="AppIpCfg" desc="ASN IP特征">
|
||||
<userRegion regionKey="ASN" regionColumn="userRegion1" userRegionPosition="1"></userRegion>
|
||||
</service>
|
||||
<service id="401" functionId="110" serviceType="1" cfgType="1" tableName="ip_comm_cfg" className="IpCommCfg" desc="IP公共分组域"></service>
|
||||
|
||||
|
||||
</serviceList>
|
||||
67
src/main/resources/sql/20190425/ip_common_config.sql
Normal file
67
src/main/resources/sql/20190425/ip_common_config.sql
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
SQLyog Professional v12.08 (64 bit)
|
||||
MySQL - 10.2.14-MariaDB : Database - ntc_test
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
|
||||
/*!40101 SET SQL_MODE=''*/;
|
||||
|
||||
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||
/*Table structure for table `ip_comm_cfg` */
|
||||
|
||||
CREATE TABLE `ip_comm_cfg` (
|
||||
`cfg_id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增',
|
||||
`cfg_desc` VARCHAR(128) DEFAULT NULL,
|
||||
`ip_type` INT(11) NOT NULL COMMENT 'IPV4=4,IPV6=6',
|
||||
`direction` INT(11) NOT NULL COMMENT '0双向,1单向,默认缺省为双向。',
|
||||
`protocol` INT(11) NOT NULL COMMENT '6表示tcp,17表示udp,0表示任意',
|
||||
`protocol_id` INT(11) NOT NULL COMMENT '非0时,maat规范需写入通用IP配置表与通用协议类型配置表 此表固定写0',
|
||||
`action` INT(11) NOT NULL COMMENT '1:阻断,2:监测, 5: FD 白名单,6:监测白名单,7: FD 监测都白名单,应与业务ID所代表的逻辑相匹配,8-灰名单',
|
||||
`is_valid` INT(11) NOT NULL COMMENT '0无效,1有效,-1删除\r\n1) 未审核时配置可删除\r\n2) 审核通过,此字段置1\r\n3) 取消审核通过,此字段置0',
|
||||
`is_audit` INT(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3取消审核通过\r\n1) 审核未通过,配置可修改\r\n2) 审核通过,配置不可删除,只能取消审核通过',
|
||||
`creator_id` INT(11) NOT NULL COMMENT '取自sys_user.id',
|
||||
`create_time` DATETIME NOT NULL,
|
||||
`editor_id` INT(11) DEFAULT NULL COMMENT '取自sys_user.id',
|
||||
`edit_time` DATETIME DEFAULT NULL,
|
||||
`auditor_id` INT(11) DEFAULT NULL COMMENT '取自sys_user.id',
|
||||
`audit_time` DATETIME DEFAULT NULL,
|
||||
`service_id` INT(11) NOT NULL COMMENT '参考系统业务类型管理表',
|
||||
`request_id` INT(11) NOT NULL COMMENT '取自request_info.id',
|
||||
`compile_id` INT(11) NULL COMMENT '取自服务接口返回的maat配置的编译id,配置初始入库时获取。',
|
||||
`is_area_effective` INT(11) NOT NULL COMMENT '0否,1是',
|
||||
`classify` VARCHAR(128) DEFAULT NULL COMMENT '分类id,多个用英文逗号分隔',
|
||||
`attribute` VARCHAR(128) DEFAULT NULL COMMENT '性质id,多个用英文逗号分隔',
|
||||
`lable` VARCHAR(128) DEFAULT NULL COMMENT '标签id,多个用英文逗号分隔',
|
||||
`area_effective_ids` VARCHAR(1024) DEFAULT NULL COMMENT '多个英文逗号分隔',
|
||||
`function_id` INT(11) NOT NULL,
|
||||
`cfg_region_code` INT(11) DEFAULT NULL,
|
||||
`cfg_type` VARCHAR(64) DEFAULT NULL,
|
||||
`src_ip_pattern` INT(11) DEFAULT NULL COMMENT '源ip格式',
|
||||
`src_ip_address` VARCHAR(128) NOT NULL,
|
||||
`src_port_pattern` INT(11) DEFAULT NULL COMMENT '源端口格式',
|
||||
`src_port` VARCHAR(16) NOT NULL,
|
||||
`dest_ip_address` VARCHAR(128) NOT NULL,
|
||||
`dest_port` VARCHAR(16) NOT NULL,
|
||||
`ratelimit` VARCHAR(10) DEFAULT NULL COMMENT '限速比例,0到1之间',
|
||||
`user_region1` VARCHAR(1024) DEFAULT NULL COMMENT '预留自定义域1',
|
||||
`user_region2` VARCHAR(1024) DEFAULT NULL COMMENT '预留自定义域2',
|
||||
`user_region3` VARCHAR(1024) DEFAULT NULL COMMENT '预留自定义域3',
|
||||
`user_region4` VARCHAR(1024) DEFAULT NULL COMMENT '预留自定义域4',
|
||||
`user_region5` VARCHAR(1024) DEFAULT NULL COMMENT '预留自定义域5',
|
||||
`cancel_request_id` INT(11) DEFAULT NULL COMMENT '取消审核来函',
|
||||
`dest_ip_pattern` INT(11) DEFAULT NULL COMMENT '目的ip格式',
|
||||
`dest_port_pattern` INT(11) DEFAULT NULL COMMENT '目的ip格式',
|
||||
`region_id` INT(11) DEFAULT NULL COMMENT '域ID',
|
||||
`group_id` INT(11) DEFAULT NULL COMMENT '组ID',
|
||||
PRIMARY KEY (`cfg_id`)
|
||||
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||
2
src/main/resources/sql/20190425/ip_group.sql
Normal file
2
src/main/resources/sql/20190425/ip_group.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
INSERT INTO function_service_dict (function_id,protocol_id,ACTION,action_code,service_id,service_name,service_desc,is_valid,creator_id,create_time,region_code,is_import,sort) VALUES(110,0,1,'monit',400,'ip_group','ip_group',1,1,NULL,1,1,1);
|
||||
INSERT INTO function_region_dict (function_id,config_district,config_region_code,config_region_value,config_desc,is_valid,is_maat,region_type,creator_id,create_time,config_ip_type,config_ip_pattern,config_port_pattern,config_direction,config_protocol,config_ip_port_show,config_region_sort,is_import)VALUES(110,'',0,'ip_group_region','ip组IP',1,1,1,1,NOW(),'4,6','1,3;1,3','1;1',0,0,3,1,1);
|
||||
@@ -122,7 +122,7 @@
|
||||
</div>
|
||||
<!-- 600 asn ip、 3:IP白名单、 405:APP协议IP、 403:APP域名特征、 563 APP Payload、 565 APP HTTP、 564 APP DNS、 566 APP SSL -->
|
||||
<c:if test="${(cfg.functionId eq 600) || (cfg.functionId eq 3) || (cfg.functionId eq 405) || (cfg.functionId eq 403) || (cfg.functionId eq 563) || (cfg.functionId eq 565) || (cfg.functionId eq 564) || (cfg.functionId eq 566) ||
|
||||
(cfg.functionId eq 560) }">
|
||||
(cfg.functionId eq 560)||(cfg.functionId eq 110) }">
|
||||
<div class="row hidden requestIdSel">
|
||||
</c:if>
|
||||
<c:if test="${(cfg.functionId ne 600) && (cfg.functionId ne 3) && (cfg.functionId ne 405) && (cfg.functionId ne 403) && (cfg.functionId ne 563) && (cfg.functionId ne 565) && (cfg.functionId ne 564) && (cfg.functionId ne 566) &&
|
||||
|
||||
368
src/main/webapp/WEB-INF/views/basics/ipCommGroupFormAdd.jsp
Normal file
368
src/main/webapp/WEB-INF/views/basics/ipCommGroupFormAdd.jsp
Normal file
@@ -0,0 +1,368 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="ip_group_configuration"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
var defaultIpInfo;
|
||||
$(function(){
|
||||
$("select[name$='protocol']").parents(".form-group").addClass("hidden");
|
||||
$("select[name$='direction']").parents(".form-group").addClass("hidden");
|
||||
defaultIpInfo=$(".ipInfo").clone();
|
||||
$(".ipAdd").click();
|
||||
$("#cfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
},
|
||||
submitHandler: function(form){
|
||||
loading('onloading...');
|
||||
form.submit();
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
});
|
||||
});
|
||||
//业务窗口打开
|
||||
var addContent = function(obj, contentClassName) {
|
||||
var showDiv = $(obj).parent().parent().siblings("."+contentClassName).last();
|
||||
if(showDiv.hasClass("hidden")){
|
||||
$(showDiv).removeClass("hidden").removeClass(
|
||||
"disabled");
|
||||
}else{
|
||||
var additional=defaultIpInfo.clone();
|
||||
additional.removeClass("hidden").removeClass(
|
||||
"disabled");
|
||||
showDiv.after(additional);
|
||||
}
|
||||
var index=0;
|
||||
$("."+contentClassName).each(function(){
|
||||
reSort($(this),index);
|
||||
index++;
|
||||
});
|
||||
$(".selectpicker").selectpicker("render");
|
||||
//$(obj).addClass("hidden");
|
||||
$("select[name$='ipType']").on("change",function(){
|
||||
switchIpInfo(this);
|
||||
});
|
||||
$("select[name$='IpPattern']").on("change",function(){
|
||||
switchIpInfo(this);
|
||||
});
|
||||
}
|
||||
|
||||
//业务窗口关闭
|
||||
var delContent = function(obj,contentClassName) {
|
||||
if($("."+contentClassName).length==1){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>");
|
||||
return;
|
||||
}
|
||||
$(obj).parents("."+contentClassName).remove();
|
||||
var index=0;
|
||||
$("."+contentClassName).each(function(){
|
||||
reSort($(this),index);
|
||||
index++;
|
||||
});
|
||||
}
|
||||
var reSort=function(obj,index){
|
||||
$(obj).find("input,select").each(function(){
|
||||
var name=$(this).attr("name");
|
||||
if(name.indexOf("ipCommGroupCfgList[")>-1){
|
||||
var namePrefix="ipCommGroupCfgList[";
|
||||
var nameSubfix=name.substring(name.indexOf("]"));
|
||||
var nameNew=namePrefix+index+nameSubfix;
|
||||
if(nameNew!=name){
|
||||
$(this).attr("name",nameNew);
|
||||
$(this).parents(".form-group").find("div[for='"+name+"']").attr("for",nameNew);
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="ip_group_configuration"></spring:message>
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-gift"></i>
|
||||
<spring:message code="add"></spring:message>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="cfgFrom" action="${ctx}/basics/ip/save" method="post" class="form-horizontal">
|
||||
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
|
||||
<input type="hidden" id="compileId" name="compileId" value="0">
|
||||
<input type="hidden" id="requestId" name="requestId" value="0">
|
||||
<input type="hidden" name="isValid" value="${_cfg.isValid}">
|
||||
<input type="hidden" name="isAudit" value="${_cfg.isAudit}">
|
||||
<c:forEach items="${serviceList}" var="service">
|
||||
<input type="hidden" id="serviceId" name="serviceId" value="${service.serviceId}">
|
||||
<input type="hidden" id="action" name="action" value="${service.action}">
|
||||
</c:forEach>
|
||||
<!-- 配置域类型 -->
|
||||
<c:forEach items="${regionList}" var="region">
|
||||
<c:if test="${_cfg.functionId eq region.functionId}">
|
||||
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
|
||||
<input type="hidden" name="cfgRegionCode"
|
||||
isMaat="${region.isMaat}"
|
||||
serviceType="${region.configServiceType}"
|
||||
ipPortShow="${region.configIpPortShow}"
|
||||
ipType="${region.configIpType}"
|
||||
srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
|
||||
destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
|
||||
srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
|
||||
destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
|
||||
direction="${region.configDirection}"
|
||||
protocol="${region.configProtocol}"
|
||||
regionType="${region.regionType}"
|
||||
value="${region.configRegionCode}">
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<div class="form-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_group"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="userRegion3" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||
<option value="${_cfg.userRegion3}"><spring:message code="select"/></option>
|
||||
<c:forEach items="${policyGroupInfos}" var="ipGroupInfo">
|
||||
<option value="${ipGroupInfo.serviceGroupId}"
|
||||
<c:if test="${_cfg.userRegion3 eq ipGroupInfo.serviceGroupId }">
|
||||
selected
|
||||
</c:if>
|
||||
>${ipGroupInfo.groupName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="userRegion3"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="form-section">
|
||||
<spring:message code="ip_group_configuration" />
|
||||
<small> <span
|
||||
class="glyphicon glyphicon-plus ipAdd"
|
||||
onClick="addContent(this,'ipInfo')" title="add"></span></small>
|
||||
</h4>
|
||||
<div class="row ipInfo boxSolid hidden disabled">
|
||||
<input type="hidden" name="ipCommGroupCfgList[0].protocolId" value="0">
|
||||
<div class="row">
|
||||
<div class="pull-right">
|
||||
<span class="glyphicon glyphicon-remove pull-right" title="remove"
|
||||
onClick="delContent(this,'ipInfo');" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="row protocol">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="protocol" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipCommGroupCfgList[0].protocol"
|
||||
class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
|
||||
<option value="${protocolC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].protocol==protocolC.itemCode || (_cfg.ipCommGroupCfgList[0].protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].protocol"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="direction" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipCommGroupCfgList[0].direction"
|
||||
class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
|
||||
<option value="${directionC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].direction==directionC.itemCode || (_cfg.ipCommGroupCfgList[0].direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].direction"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_type"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipCommGroupCfgList[0].ipType" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
|
||||
<option value="${ipTypeC.itemCode}"
|
||||
<c:if test="${_cfg.ipCommGroupCfgList[0].ipType==ipTypeC.itemCode
|
||||
|| (_cfg.ipCommGroupCfgList[0].ipType==null && ipTypeC.itemCode==4)}">
|
||||
selected
|
||||
</c:if>
|
||||
>
|
||||
<spring:message code="${ipTypeC.itemValue}"/>
|
||||
</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].ipType"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="src_ip_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipCommGroupCfgList[0].srcIpPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||||
<option value="${ipPatternC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].srcIpPattern==ipPatternC.itemCode || (_cfg.ipCommGroupCfgList[0].srcIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].srcIpPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_ip"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required ipCheck" type="text" name="ipCommGroupCfgList[0].srcIpAddress" value="${_cfg.ipCommGroupCfgList[0].srcIpAddress}">
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].srcIpAddress"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="src_port_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipCommGroupCfgList[0].srcPortPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||||
<option value="${portPatternC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].srcPortPattern==portPatternC.itemCode || (_cfg.ipCommGroupCfgList[0].srcPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].srcPortPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_port"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required portCheck" type="text" name="ipCommGroupCfgList[0].srcPort" value="${_cfg.ipCommGroupCfgList[0].srcPort}">
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].srcPort"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipCommGroupCfgList[0].destIpPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||||
<option value="${ipPatternC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].destIpPattern==ipPatternC.itemCode || (_cfg.ipCommGroupCfgList[0].destIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].destIpPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required ipCheck" type="text" name="ipCommGroupCfgList[0].destIpAddress" value="${_cfg.ipCommGroupCfgList[0].destIpAddress}">
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].destIpAddress"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="dest_port_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipCommGroupCfgList[0].destPortPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||||
<option value="${portPatternC.itemCode}" <c:if test="${_cfg.ipCommGroupCfgList[0].destPortPattern==portPatternC.itemCode || (_cfg.ipCommGroupCfgList[0].destPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].destPortPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_port"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required portCheck" type="text" name="ipCommGroupCfgList[0].destPort" value="${_cfg.ipCommGroupCfgList[0].destPort}">
|
||||
</div>
|
||||
<div for="ipCommGroupCfgList[0].destPort"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%-- <div class="row">
|
||||
<button type="button" class="btn btn-red-hollow center-block"
|
||||
onClick="more(this);" data-click-times="0">
|
||||
<spring:message code="show_more" />
|
||||
</button>
|
||||
</div> --%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-8">
|
||||
<c:set var="auditPermission" value="false"></c:set>
|
||||
<!-- 拥有配置新增直接生效的功能权限 -->
|
||||
<shiro:hasPermission name="save:audit:permission">
|
||||
<c:set var="auditPermission" value="true"></c:set>
|
||||
</shiro:hasPermission>
|
||||
<c:choose>
|
||||
<c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
|
||||
<button id="audit" type="submit" class="btn green">
|
||||
<spring:message code="submit" />
|
||||
</button>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<button id="save" type="submit" class="btn green">
|
||||
<spring:message code="submit" />
|
||||
</button>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6"> </div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
327
src/main/webapp/WEB-INF/views/basics/ipCommGroupFormUpdate.jsp
Normal file
327
src/main/webapp/WEB-INF/views/basics/ipCommGroupFormUpdate.jsp
Normal file
@@ -0,0 +1,327 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="ip_group_configuration"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("select[name='protocol']").parents(".form-group").addClass("hidden");
|
||||
$("select[name='direction']").parents(".form-group").addClass("hidden");
|
||||
$("#cfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
},
|
||||
submitHandler: function(form){
|
||||
loading('onloading...');
|
||||
form.submit();
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="ip_group_configuration"></spring:message>
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-gift"></i>
|
||||
<spring:message code="edit"></spring:message>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="cfgFrom" action="${ctx}/basics/ip/update" method="post" class="form-horizontal">
|
||||
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
||||
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
||||
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||
<c:choose>
|
||||
<c:when test="${_cfg.isAudit ne 1}">
|
||||
<input type="hidden" name="isValid" value="0">
|
||||
<input type="hidden" name="isAudit" value="0">
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<input type="hidden" name="isValid" value="${_cfg.isValid}">
|
||||
<input type="hidden" name="isAudit" value="${_cfg.isAudit}">
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<input type="hidden" id="regionId" name="regionId" value="${_cfg.regionId}">
|
||||
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
||||
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
|
||||
<input type="hidden" id="requestId" name="requestId" value="${_cfg.requestId}">
|
||||
<input type="hidden" id="protocolId" name="protocolId" value="${_cfg.protocolId}">
|
||||
<!-- 配置域类型 -->
|
||||
<c:forEach items="${regionList}" var="region">
|
||||
<c:if test="${_cfg.functionId eq region.functionId}">
|
||||
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
|
||||
<input type="hidden" name="cfgRegionCode"
|
||||
isMaat="${region.isMaat}"
|
||||
serviceType="${region.configServiceType}"
|
||||
ipPortShow="${region.configIpPortShow}"
|
||||
ipType="${region.configIpType}"
|
||||
srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
|
||||
destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
|
||||
srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
|
||||
destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
|
||||
direction="${region.configDirection}"
|
||||
protocol="${region.configProtocol}"
|
||||
regionType="${region.regionType}"
|
||||
value="${region.configRegionCode}">
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<div class="form-body">
|
||||
<!-- desc and action -->
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ipGroup"/></label>
|
||||
<div class="col-md-6">
|
||||
<%-- <input class="form-control required digits asnMustExists" type="text" name="${cfgName}.cfgKeywords" value="${cfg.cfgKeywords}" ctx="${ctx}"> --%>
|
||||
<select name="groupId" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||
<option value="${_cfg.groupId}"><spring:message code="select"/></option>
|
||||
<c:forEach items="${policyGroupInfos}" var="ipGroupInfo">
|
||||
<option value="${ipGroupInfo.serviceGroupId}"
|
||||
<c:if test="${_cfg.groupId eq ipGroupInfo.serviceGroupId }">
|
||||
selected
|
||||
</c:if>
|
||||
>${ipGroupInfo.groupName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="groupId"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 hidden">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="action"/></label>
|
||||
<div class="col-md-6">
|
||||
<c:forEach items="${serviceList}" var="service"
|
||||
varStatus="satus">
|
||||
<label class="radio-inline"> <c:if
|
||||
test="${_cfg.functionId eq service.functionId}">
|
||||
<input type="radio" name="action"
|
||||
serviceId="${service.serviceId }"
|
||||
protocolId="${service.protocolId }"
|
||||
value="${service.action }" class="required action"
|
||||
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
|
||||
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
|
||||
<c:if test="${dict.itemCode eq service.action }">
|
||||
<spring:message code="${dict.itemValue }"/>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</label>
|
||||
</c:forEach>
|
||||
</div>
|
||||
<div for="action"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row ipInfo">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="protocol" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="protocol"
|
||||
class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC">
|
||||
<option value="${protocolC.itemCode}" <c:if test="${_cfg.protocol==protocolC.itemCode || (_cfg.protocol==null && protocolC.itemCode==0)}">selected</c:if>><spring:message code="${protocolC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="protocol"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="direction" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="direction"
|
||||
class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC">
|
||||
<option value="${directionC.itemCode}" <c:if test="${_cfg.direction==directionC.itemCode || (_cfg.direction==null && directionC.itemCode==0)}">selected</c:if>><spring:message code="${directionC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="direction"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_type"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="ipType" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('WHITELIST_IPTYPE')}" var="ipTypeC">
|
||||
<option value="${ipTypeC.itemCode}"
|
||||
<c:if test="${_cfg.ipType==ipTypeC.itemCode
|
||||
|| (_cfg.ipType==null && ipTypeC.itemCode==4)}">
|
||||
selected
|
||||
</c:if>
|
||||
>
|
||||
<spring:message code="${ipTypeC.itemValue}"/>
|
||||
</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipType"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="src_ip_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="srcIpPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||||
<option value="${ipPatternC.itemCode}" <c:if test="${_cfg.srcIpPattern==ipPatternC.itemCode || (_cfg.srcIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_ip"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required ipCheck" type="text" name="srcIpAddress" value="${_cfg.srcIpAddress}">
|
||||
</div>
|
||||
<div for="srcIpAddress"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="src_port_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="srcPortPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||||
<option value="${portPatternC.itemCode}" <c:if test="${_cfg.srcPortPattern==portPatternC.itemCode || (_cfg.srcPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="srcPortPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_port"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required portCheck" type="text" name="srcPort" value="${_cfg.srcPort}">
|
||||
</div>
|
||||
<div for="srcPort"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="dest_ip_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="destIpPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||||
<option value="${ipPatternC.itemCode}" <c:if test="${_cfg.destIpPattern==ipPatternC.itemCode || (_cfg.destIpPattern==null && ipPatternC.itemCode==3)}">selected</c:if>><spring:message code="${ipPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="ipPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required ipCheck" type="text" name="destIpAddress" value="${_cfg.destIpAddress}">
|
||||
</div>
|
||||
<div for="destIpAddress"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="dest_port_pattern"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="destPortPattern" class="selectpicker show-tick form-control required">
|
||||
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC">
|
||||
<option value="${portPatternC.itemCode}" <c:if test="${_cfg.destPortPattern==portPatternC.itemCode || (_cfg.destPortPattern==null && portPatternC.itemCode==1)}">selected</c:if>><spring:message code="${portPatternC.itemValue}"/></option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="destportPattern"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_port"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required portCheck" type="text" name="destPort" value="${_cfg.destPort}">
|
||||
</div>
|
||||
<div for="destPort"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<%-- <%@include file="/WEB-INF/include/form/basicInfo.jsp" %> --%>
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-8">
|
||||
<c:set var="auditPermission" value="false"></c:set>
|
||||
<!-- 拥有配置新增直接生效的功能权限 -->
|
||||
<shiro:hasPermission name="save:audit:permission">
|
||||
<c:set var="auditPermission" value="true"></c:set>
|
||||
</shiro:hasPermission>
|
||||
<c:choose>
|
||||
<c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
|
||||
<button id="audit" type="submit" class="btn green">
|
||||
<spring:message code="submit" />
|
||||
</button>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<button id="save" type="submit" class="btn green">
|
||||
<spring:message code="submit" />
|
||||
</button>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6"> </div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
367
src/main/webapp/WEB-INF/views/basics/ipCommonGroupCfgList.jsp
Normal file
367
src/main/webapp/WEB-INF/views/basics/ipCommonGroupCfgList.jsp
Normal file
@@ -0,0 +1,367 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="ip_group_configuration"></spring:message></title>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//搜索框提示语初始化
|
||||
if("${cfg.cfgDesc}"){
|
||||
$("#intype").val("${cfg.cfgDesc}");
|
||||
}else if("${cfg.destIpAddress}"){
|
||||
$("#intype").val("${cfg.destIpAddress}");
|
||||
}else{
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
|
||||
}
|
||||
$("#seltype").change(function(){
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
|
||||
});
|
||||
//筛选功能初始化
|
||||
filterActionInit();
|
||||
$("#isAudit").change(function(){
|
||||
page();
|
||||
});
|
||||
//reset
|
||||
$("#resetBtn").on("click",function(){
|
||||
$("select.selectpicker").each(function(){
|
||||
$(this).selectpicker('val',$(this).find('option:first').val());
|
||||
$(this).find("option").attr("selected",false);
|
||||
$(this).find("option:first").attr("selected",true);
|
||||
});
|
||||
$(".Wdate").attr("value",'');
|
||||
$("#description").attr("value",'');
|
||||
$("#searchForm")[0].reset();
|
||||
});
|
||||
|
||||
if($("#exportType").val() != null && $("#exportType").val() != ""){
|
||||
if($("#intype").val() != null && $("#intype").val() != ""){
|
||||
$("#exportValue").val($("#intype").val());
|
||||
}
|
||||
}
|
||||
//修改form表单action
|
||||
var importPath="/basics/ip/list?functionId=${cfg.functionId}"
|
||||
$("#importForm1").attr("action","${ctx}/basics/ip/import?importPath="+importPath);
|
||||
ajaxGroupName();
|
||||
});
|
||||
var edit=function(url){
|
||||
var cked = $('tbody tr td input.i-checks:checkbox:checked');
|
||||
if(cked.val()==1){
|
||||
top.$.jBox.tip("<spring:message code='has_approved'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
if(cked.length==1){
|
||||
window.location = url+"&compileId="+cked.attr("id");
|
||||
}else{
|
||||
top.$.jBox.tip("<spring:message code='check_one'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
var ajaxGroupName=function(){
|
||||
var groupIds=[];
|
||||
$(".group").each(function(){
|
||||
if(groupIds.join(",").indexOf($(this).text().trim())==-1){
|
||||
groupIds.push($(this).text().trim());
|
||||
}
|
||||
});
|
||||
$.ajax({
|
||||
type:'post',
|
||||
timeout:10000,//超时时间设置,查询接口时间过长超时
|
||||
url:'${ctx}/basics/ip/ajaxGetGroups',
|
||||
data:{"groupIds":groupIds.join(',')},
|
||||
dataType:'json',
|
||||
async:true,
|
||||
success:function(data,textStatus){//处理返回结果
|
||||
if(textStatus=="success"){
|
||||
$(".group").each(function(){
|
||||
var text=$(this);
|
||||
$.each(data,function(key,values){
|
||||
console.log(key);
|
||||
if(key==$(text).text()){
|
||||
$(text).html(values);
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
|
||||
<shiro:hasPermission name="ip:common:config">
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/basics/ip/addForm?functionId=${cfg.functionId}'">
|
||||
<i class="fa fa-plus"></i>
|
||||
<spring:message code="add"></spring:message></button>
|
||||
<c:set var="regionImport" value="false"></c:set>
|
||||
<c:forEach items="${regionList}" var="region" >
|
||||
<c:if test="${(cfg.functionId eq region.functionId) && region.isImport eq 1}">
|
||||
<c:set var="regionImport" value="true"></c:set>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<c:if test="${regionImport eq 'true'}">
|
||||
<button type="button" class="btn btn-primary import" >
|
||||
<i class="fa fa-plus"></i>
|
||||
<spring:message code="import"></spring:message></button>
|
||||
</c:if>
|
||||
</shiro:hasPermission>
|
||||
</div>
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="ip_group_configuration"></spring:message>
|
||||
</h3>
|
||||
<h5 class="page-header"></h5>
|
||||
<div class="col-md-12">
|
||||
<div class="portlet">
|
||||
<div class="portlet-body">
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/basics/ip/list?functionId=${cfg.functionId}" method="post" class="form-search">
|
||||
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
|
||||
<input id="audit" name="audit" type="hidden" value="${audit}"/>
|
||||
<input id="exportType" type="hidden" value="${cfg.seltype}"/>
|
||||
<input id="exportValue" type="hidden" value=""/>
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}"
|
||||
callback="page();" />
|
||||
<!-- 筛选按钮展开状态-->
|
||||
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${cfg.isFilterAction }"/>
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
<div class="col-md-12">
|
||||
<div class="pull-left">
|
||||
<c:set var="state"><spring:message code='group'/></c:set>
|
||||
<form:select path="isAudit" class="selectpicker select2 input-small">
|
||||
<form:option value=""><spring:message code="all_states"/></form:option>
|
||||
<form:option value="0"><spring:message code="created"></spring:message></form:option>
|
||||
<form:option value="1"><spring:message code="approved"></spring:message></form:option>
|
||||
<form:option value="2"><spring:message code="unapproved"></spring:message></form:option>
|
||||
<form:option value="3"><spring:message code="cancel_approved"></spring:message></form:option>
|
||||
</form:select>
|
||||
</div>
|
||||
|
||||
<div class="pull-left">
|
||||
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
|
||||
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
|
||||
<form:option value="destIpAddress"><spring:message code="IP"></spring:message></form:option>
|
||||
<form:option value="isValid"><spring:message code="valid_identifier"></spring:message></form:option>
|
||||
</form:select>
|
||||
|
||||
</div>
|
||||
|
||||
<input id="intype" class="form-control input-medium" type="text" value="">
|
||||
<div class="input-group-btn">
|
||||
<form:select path="isValid" class="selectpicker select2 input-small" >
|
||||
<form:option value=""><spring:message code="select"/></form:option>
|
||||
<form:option value="1"><spring:message code="yes"/></form:option>
|
||||
<form:option value="0"><spring:message code="no"/></form:option>
|
||||
</form:select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<form:select path="groupId" class="selectpicker select2 input-small" data-live-search="true" data-live-search-placeholder="search">
|
||||
<form:option value=""><spring:message code='ip_group'/></form:option>
|
||||
<c:forEach items="${policyGroupInfos}" var="policyGroup">
|
||||
<form:option value="${policyGroup.groupId}"><spring:message code='${policyGroup.groupName}'/></form:option>
|
||||
</c:forEach>
|
||||
</form:select>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
||||
<button type="button" class="btn btn-default" id="resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/> <i class="fa fa-angle-double-down"></i></button>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<shiro:hasPermission name="ip:common:config">
|
||||
<sys:delRow url="${ctx}/basics/ip/updateForm?functionId=${cfg.functionId}" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/basics/ip/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/basics/ip/exportIpComm?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/basics/ip/list?functionId=${cfg.functionId}" id="contentTable" maxRow="5" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basics/ip/exportIpComm?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/basics/ip/list?functionId=${cfg.functionId}" id="contentTable" maxRow="5" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<shiro:hasPermission name="asn:ip:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right">
|
||||
<li><sys:delRow url="${ctx}/basics/ip/audit?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basics/ip/audit?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basics/ip/audit?isAudit=3&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="cancelPass"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
</shiro:hasPermission>
|
||||
<a class="btn btn-icon-only btn-default setfields tooltips"
|
||||
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
|
||||
<i class="icon-wrench"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /搜索内容与操作按钮栏 -->
|
||||
|
||||
<!-- 筛选搜索内容栏默认隐藏-->
|
||||
<div class="col-md-12 filter-action-select-panle hide" >
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label><spring:message code="config_time"/>:</label>
|
||||
<input name="search_create_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value='${cfg.search_create_time_start}' pattern='yyyy-MM-dd HH:mm:ss'/>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label> </label>
|
||||
<input name="search_create_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${cfg.search_create_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label><spring:message code="edit_time"/>:</label>
|
||||
<input name="search_edit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${cfg.search_edit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label> </label>
|
||||
<input name="search_edit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${cfg.search_edit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label><spring:message code="audit_time"/>:</label>
|
||||
<input name="search_audit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${cfg.search_audit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label> </label>
|
||||
<input name="search_audit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${cfg.search_audit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- /筛选搜索内容栏 结束-->
|
||||
</form:form>
|
||||
</div>
|
||||
<sys:message content="${message}" type="${messageType }"/>
|
||||
<div class="table-responsive">
|
||||
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<th class="sort-column r.compile_id" style="display: none;" column="cfg_id" ><spring:message code="cfg_id"/></th>
|
||||
<%-- <th><spring:message code="seq"/></th> --%>
|
||||
<th column="config_describe" ><spring:message code="config_describe"/></th>
|
||||
<%-- <th><spring:message code="group"/></th> --%>
|
||||
<th class="sort-column r.user_region3" column="userregion3" ><spring:message code="ip_group"/></th>
|
||||
<th column="ip_type" ><spring:message code="ip_type"/></th>
|
||||
<th column="IP" ><spring:message code="IP"/></th>
|
||||
<th column="ip_pattern" ><spring:message code="ip_pattern"/></th>
|
||||
<th><spring:message code="classification"/></th>
|
||||
<th><spring:message code="attribute"/></th>
|
||||
<th><spring:message code="label"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<%-- <th><spring:message code="log_total"/></th> --%>
|
||||
<th column="valid_identifier" ><spring:message code="valid_identifier"/></th>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th column="config_time" class="sort-column r.create_time"><spring:message code="config_time"/></th>
|
||||
<th column="editor" ><spring:message code="editor"/></th>
|
||||
<th column="edit_time" class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
|
||||
<th><spring:message code="auditor"/></th>
|
||||
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
|
||||
<%-- <th><spring:message code="operation"></spring:message></th> --%>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
|
||||
<tr>
|
||||
<td><input type="checkbox" class="i-checks" id="${cfg.cfgId}" isValid="${cfg.isValid}" value="${cfg.isAudit}"></td>
|
||||
<td>${cfg.compileId }</td>
|
||||
<td>${cfg.cfgDesc }</td>
|
||||
<td class="group">${cfg.groupId}</td>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipTypeC">
|
||||
<c:if test="${cfg.ipType==ipTypeC.itemCode}"><spring:message code="${ipTypeC.itemValue }"/></c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td title="${cfg.destIpAddress }">${fns:abbr(cfg.destIpAddress, 42)}</td>
|
||||
<%-- <td>${cfg.destPort }</td> --%>
|
||||
<td>
|
||||
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC">
|
||||
<c:if test="${cfg.destIpPattern==ipPatternC.itemCode}"><spring:message code="${ipPatternC.itemValue }"/></c:if>
|
||||
</c:forEach>
|
||||
</td>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${cfg.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
|
||||
<c:when test="${cfg.isAudit eq '1'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:when>
|
||||
<c:when test="${cfg.isAudit eq '2'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:when>
|
||||
<c:when test="${cfg.isAudit eq '3'}"><span class="label label-warning"><spring:message code="cancel_approved"></spring:message></span></c:when>
|
||||
|
||||
</c:choose>
|
||||
</td>
|
||||
<%-- <td audit="${cfg.isAudit}" functionId="${cfg.functionId}" compileId="${cfg.compileId}" action="${cfg.action}"><div class="loading-total"></div></td> --%>
|
||||
<td>
|
||||
<c:if test="${cfg.isValid==0}"><spring:message code="no"/></c:if>
|
||||
<c:if test="${cfg.isValid==1}"><spring:message code="yes"/></c:if>
|
||||
<c:if test="${cfg.isValid==-1}"><spring:message code="deleted"/></c:if>
|
||||
</td>
|
||||
<td>${cfg.creatorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${cfg.editorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${cfg.auditorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="page">${page}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 模板导入,start -->
|
||||
<%@include file="/WEB-INF/include/excel/importModal.jsp" %>
|
||||
</body>
|
||||
</html>
|
||||
452
src/main/webapp/WEB-INF/views/basics/urlCommGroupFormAdd.jsp
Normal file
452
src/main/webapp/WEB-INF/views/basics/urlCommGroupFormAdd.jsp
Normal file
@@ -0,0 +1,452 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="url_group_configuration"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
var defaultIpInfo;
|
||||
var protectedList = [".com"];
|
||||
$(function(){
|
||||
|
||||
defaultIpInfo=$(".strInfo").clone(true);
|
||||
|
||||
// reSort($(defaultIpInfo),-1);
|
||||
$(".asnIpAdd").click();
|
||||
$("#cfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
if($(element).parents().hasClass("tagsinput")){
|
||||
$(element).parents(".col-md-6").next("div").append(error);
|
||||
}else{
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
}
|
||||
},
|
||||
submitHandler: function(form){
|
||||
/* $("[name='country']").val($("[name='userRegion1'] option:selected").attr("country"));
|
||||
$("[name='detail']").val($("[name='userRegion1'] option:selected").attr("detail"));
|
||||
$("[name='asnIpGroup']").val($("[name='userRegion1'] option:selected").attr("asnIpGroup")); */
|
||||
var flag = true;
|
||||
/* $(".boxSolid:visible").find("input[name$='cfgKeywords']").each(function(){
|
||||
if($(this).val()==''){
|
||||
$(this).parents(".form-group").find(
|
||||
"div[for='"
|
||||
+ $(this).attr("name")
|
||||
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$("#keywordError").text()+"</label>");
|
||||
flag = false;
|
||||
}
|
||||
}); */
|
||||
$(".tagsinput:visible").each(function(){
|
||||
var text='';
|
||||
$(this).find(".tag").each(function(){
|
||||
text+=$(this).children("span").text().trim();
|
||||
});
|
||||
if(text.length < 4 || text.length > 1024){
|
||||
$(this).parents(".col-md-6").next("div").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$.validator.messages.keywordLength+"</label>");
|
||||
if(flag){
|
||||
flag=false;
|
||||
}
|
||||
}
|
||||
});
|
||||
if(flag){
|
||||
loading('onloading...');
|
||||
form.submit();
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
//业务窗口打开
|
||||
var addContent = function(obj, contentClassName) {
|
||||
var showDiv = $(obj).parent().parent().siblings("."+contentClassName).last();
|
||||
if(showDiv.hasClass("hidden")){
|
||||
$(showDiv).removeClass("hidden").removeClass(
|
||||
"disabled");
|
||||
}else{
|
||||
var additional=defaultIpInfo.clone();
|
||||
additional.removeClass("hidden").removeClass(
|
||||
"disabled");
|
||||
showDiv.after(additional);
|
||||
}
|
||||
var index=0;
|
||||
$("."+contentClassName).each(function(){
|
||||
reSort($(this),index);
|
||||
// $(".tags").attr("id","tags_"+index);
|
||||
$("input[name='urlCommGroupList["+index+"].cfgKeywords']").attr("id","tags_"+index);
|
||||
index++;
|
||||
});
|
||||
$(".selectpicker").selectpicker("render");
|
||||
|
||||
var flag1=0;
|
||||
$(".tagsinput").each(function(){
|
||||
$(this).attr("id","tags_"+flag1+"_tagsinput");
|
||||
if(flag1>0 && flag1==($(".tagsinput").length-1)){
|
||||
$("#tags_"+flag1+"_tagsinput").remove();
|
||||
inputToDiv();
|
||||
}
|
||||
flag1++;
|
||||
});
|
||||
}
|
||||
|
||||
//业务窗口关闭
|
||||
var delContent = function(obj,contentClassName) {
|
||||
if($("."+contentClassName).length==1){
|
||||
top.$.jBox.tip("<spring:message code='one_more'/>");
|
||||
return;
|
||||
}
|
||||
$(obj).parents("."+contentClassName).remove();
|
||||
var index=0;
|
||||
$("."+contentClassName).each(function(){
|
||||
reSort($(this),index);
|
||||
index++;
|
||||
});
|
||||
|
||||
}
|
||||
var reSort=function(obj,index){
|
||||
$(obj).find("input,select").each(function(){
|
||||
var name=$(this).attr("name");
|
||||
if(name != undefined){
|
||||
if(name.indexOf("urlCommGroupList[")>-1){
|
||||
var namePrefix="urlCommGroupList[";
|
||||
var nameSubfix=name.substring(name.indexOf("]"));
|
||||
var nameNew=namePrefix+index+nameSubfix;
|
||||
// $(".tags").attr("id","tags_"+index);
|
||||
if(nameNew!=name){
|
||||
$(this).attr("name",nameNew);
|
||||
$(this).parents(".form-group").find("div[for='"+name+"']").attr("for",nameNew);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
//input框标签化方法
|
||||
function inputToDiv(){
|
||||
|
||||
var tagsInputSettings1="#tags";
|
||||
var options;
|
||||
var flag2=0;
|
||||
$("input[name$='cfgKeywords']").each(function(){
|
||||
var tagsId = $(this).attr("id");
|
||||
var objNamePrefix = $(this).attr("name").split("cfgKeywords")[0];
|
||||
var isTags = $(this).hasClass("tags");//有tags样式的关键字输入框才需处理
|
||||
if(typeof(tagsId)!=='undefined' && tagsId.indexOf("tags_")!=-1 && isTags){
|
||||
// 表达式类型初始
|
||||
if($("input:radio[name='"+objNamePrefix+"exprType'][checked=checked]").val()==1){
|
||||
options = $("select[name='"+objNamePrefix+"matchMethod']").find("option[value!=0]");
|
||||
$("select[name='"+objNamePrefix+"matchMethod']").find("option[value!=0]").remove();
|
||||
}else{
|
||||
options = $("select[name='"+objNamePrefix+"matchMethod']").find("option[value!=0]");
|
||||
}
|
||||
//表单中如果有关键字内容可能输入多个关键字的情况,根据输入关键字个数确定表达式选中情况,不允许手动选中
|
||||
if($("select[name='"+objNamePrefix+"district']").val()!="Payload"){//如果是app 的payload特征,可选择表达式
|
||||
$("input:radio[name='"+objNamePrefix+"exprType']").attr("disabled",true);
|
||||
}
|
||||
|
||||
if(tagsId !="tags_0" && flag2>0 && flag2==($("input[name$='cfgKeywords']").length-1)){
|
||||
tagsInputSettings1 = tagsInputSettings1+",#"+tagsId;
|
||||
}
|
||||
flag2++;
|
||||
}
|
||||
|
||||
});
|
||||
$(tagsInputSettings1).tagsInput({
|
||||
width:$(tagsInputSettings1).find(".form-control").width(),
|
||||
defaultText:'please input keywords',
|
||||
'delimiter':'***and***',//特殊字符串分隔与表达式的多关键词
|
||||
maxCount:4,
|
||||
onAddTag:function(tag,size){
|
||||
var reg = new RegExp(/\t|\r|\n/);
|
||||
/* if (tag.match(reg)) {
|
||||
$(this).parent(".col-md-6").next("div").html("<label class='error'>"+$.validator.messages.hasInvisibleChar.replace("{0}","'"+tag+"'")+"</label>");
|
||||
}else{
|
||||
$(this).parent(".col-md-6").next("div").html("");
|
||||
} */
|
||||
//var keywordValue = "";
|
||||
var objNamePrefix = $(this).attr("name").split("cfgKeywords")[0];
|
||||
/*$("span[class='tag']").each(function(){
|
||||
keywordValue = keywordValue+"***iie***"+$(this).find("span").text().trim();
|
||||
});
|
||||
$(this).prev("input[name$='cfgKeywords']").val(keywordValue);*/
|
||||
exprTypeChecked(objNamePrefix,size,options);
|
||||
if($(this).hasClass("urlCheck")){
|
||||
protectedListWarn($("#"+$(this).attr("id")+"_tagsinput"),$(this).val(),protectedList);
|
||||
}
|
||||
},
|
||||
onRemoveTag:function(tag,size){
|
||||
// $(this).parent(".col-md-6").next("div").html("");
|
||||
//var keywordValue = "";
|
||||
var objNamePrefix = $(this).attr("name").split("cfgKeywords")[0];
|
||||
/*$("span[class='tag']").each(function(){
|
||||
keywordValue = keywordValue+"***iie***"+$(this).find("span").text().trim();
|
||||
});
|
||||
$(this).prev("input[name$='cfgKeywords']").val(keywordValue);*/
|
||||
exprTypeChecked(objNamePrefix,size,options);
|
||||
if($(this).hasClass("urlCheck")){
|
||||
protectedListWarn($("#"+$(this).attr("id")+"_tagsinput"),$(this).val(),protectedList);
|
||||
}
|
||||
}
|
||||
});
|
||||
$(".tagsinput").popover({
|
||||
animation:true,
|
||||
container:'body',
|
||||
placement:'right',
|
||||
html:true,
|
||||
trigger:"hover",
|
||||
title:"",
|
||||
content:function(){
|
||||
var content = $("#tagsinputTip").text();
|
||||
return content;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
|
||||
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
|
||||
<div class="page-content">
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="url_group_configuration"></spring:message>
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-gift"></i>
|
||||
<spring:message code="add"></spring:message>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="cfgFrom" action="${ctx}/basics/url/save" method="post" class="form-horizontal">
|
||||
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
|
||||
<input type="hidden" id="compileId" name="compileId" value="0">
|
||||
<input type="hidden" id="requestId" name="requestId" value="0">
|
||||
<input type="hidden" id="asnIpGroup" name="asnIpGroup" value="0">
|
||||
<c:forEach items="${serviceList}" var="service">
|
||||
<input type="hidden" id="serviceId" name="serviceId" value="${service.serviceId}">
|
||||
<input type="hidden" id="action" name="action" value="${service.action}">
|
||||
</c:forEach>
|
||||
<!-- 配置域类型 -->
|
||||
<c:forEach items="${regionList}" var="region">
|
||||
<c:if test="${_cfg.functionId eq region.functionId}">
|
||||
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
|
||||
<input type="hidden" name="cfgRegionCode"
|
||||
isMaat="${region.isMaat}"
|
||||
serviceType="${region.configServiceType}"
|
||||
ipPortShow="${region.configIpPortShow}"
|
||||
ipType="${region.configIpType}"
|
||||
srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
|
||||
destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
|
||||
srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
|
||||
destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
|
||||
direction="${region.configDirection}"
|
||||
protocol="${region.configProtocol}"
|
||||
regionType="${region.regionType}"
|
||||
value="${region.configRegionCode}">
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<div class="form-body">
|
||||
<!-- desc and action -->
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="urlGroup"/></label>
|
||||
<div class="col-md-6">
|
||||
<select name="userRegion3" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||
<option value=""><spring:message code="select"/></option>
|
||||
<c:forEach items="${policyGroupInfos}" var="urlGroupInfo">
|
||||
<option value="${urlGroupInfo.serviceGroupId}">${urlGroupInfo.groupName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="userRegion3"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- desc and action -->
|
||||
<h4 class="form-section">
|
||||
<spring:message code="http_url_title" />
|
||||
<small> <span
|
||||
class="glyphicon glyphicon-plus asnIpAdd"
|
||||
onClick="addContent(this,'strInfo')" title="add"></span></small>
|
||||
</h4>
|
||||
<div class="row strInfo boxSolid asnIp hidden disabled">
|
||||
<!-- <input type="hidden" name="asnIpCfgs[0].protocolId" value="0"> -->
|
||||
<div class="row">
|
||||
<div class="pull-right">
|
||||
<span class="glyphicon glyphicon-remove pull-right" title="remove"
|
||||
onClick="delContent(this,'strInfo');" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<c:forEach items="${regionList}" var="region" varStatus="status">
|
||||
<%-- <c:set var="cfgName" value="urlCommGroupList[-1]"></c:set> --%>
|
||||
<%-- <input type="hidden" name="${cfgName}.sourceCompileId" value="${cfg.sourceCompileId }"> --%>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="keywords" />
|
||||
</label>
|
||||
<!-- 此配置的关键词可以输入多个关键词 -->
|
||||
<c:if test="${region.configMultiKeywords eq 1}">
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required tags <c:if test="${fn:containsIgnoreCase(region.configServiceType,'domain') }"> domainCheck </c:if> <c:if test="${fn:containsIgnoreCase(region.configServiceType,'url') }"> urlCheck </c:if>" type="text" id="tags_${status.index}"
|
||||
name="urlCommGroupList[-1].cfgKeywords"
|
||||
>
|
||||
</div>
|
||||
</c:if>
|
||||
<!-- 此配置的关键词不允许输入多个关键词 -->
|
||||
<c:if test="${(region.configMultiKeywords eq 0) or (empty region.configMultiKeywords)}">
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required invisibleChar
|
||||
<c:if test="${fn:containsIgnoreCase(region.configServiceType,'domain') }"> domainCheck </c:if>
|
||||
<c:if test="${fn:containsIgnoreCase(region.configServiceType,'url') }"> urlCheck </c:if>
|
||||
"
|
||||
type="text"
|
||||
name="urlCommGroupList[-1].cfgKeywords"
|
||||
>
|
||||
</div>
|
||||
</c:if>
|
||||
<div for="urlCommGroupList[-1].cfgKeywords"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 exprType">
|
||||
<div class="form-group">
|
||||
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="expression_type" /></label>
|
||||
<div class="col-md-6">
|
||||
<c:if test="${!empty region.configExprType}">
|
||||
<c:forEach var="exprType" items="${fn:split(region.configExprType,',')}" varStatus="stat" >
|
||||
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC" >
|
||||
<c:if test="${exprTypeC.itemCode eq exprType}">
|
||||
<label class="radio-inline">
|
||||
<input type="radio"
|
||||
name="urlCommGroupList[-1].exprType" value="${exprType }"
|
||||
class="required"
|
||||
<c:if test="${stat.index == 0 }"> checked </c:if>
|
||||
|
||||
>
|
||||
<spring:message code="${exprTypeC.itemValue }" />
|
||||
</label>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
<c:if test="${empty region.configExprType}">
|
||||
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC">
|
||||
<c:if test="${exprTypeC.itemCode eq 0}">
|
||||
<label class="radio-inline">
|
||||
<input type="radio"
|
||||
name="urlCommGroupList[-1].exprType" value="${exprTypeC.itemCode }"
|
||||
class="required" checked >
|
||||
<spring:message code="${exprTypeC.itemValue }" />
|
||||
</label>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</div>
|
||||
<div for="urlCommGroupList[-1].exprType"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 matchMethod">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="match_method" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="urlCommGroupList[-1].matchMethod"
|
||||
class="selectpicker select2 form-control required ">
|
||||
<c:if test="${!empty region.configMatchMethod}">
|
||||
<c:forEach var="matchMethod" items="${fn:split(region.configMatchMethod,',')}">
|
||||
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
|
||||
<c:if test="${matchMethodC.itemCode eq matchMethod}">
|
||||
<option value="${matchMethodC.itemCode}"
|
||||
>
|
||||
<spring:message code="${matchMethodC.itemValue}"/>
|
||||
</option>
|
||||
</c:if>
|
||||
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
<c:if test="${empty region.configMatchMethod}">
|
||||
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
|
||||
<c:if test="${matchMethodC.itemCode eq 0}">
|
||||
<option value="${matchMethodC.itemCode}"
|
||||
selected
|
||||
>
|
||||
<spring:message code="${matchMethodC.itemValue}"/>
|
||||
</option>
|
||||
</c:if>
|
||||
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</select>
|
||||
</div>
|
||||
<div for="urlCommGroupList[-1].matchMethod"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</c:forEach>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<%-- <div class="row">
|
||||
<button type="button" class="btn btn-red-hollow center-block"
|
||||
onClick="more(this);" data-click-times="0">
|
||||
<spring:message code="show_more" />
|
||||
</button>
|
||||
</div> --%>
|
||||
|
||||
|
||||
<div class="form-actions">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-8">
|
||||
<button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
|
||||
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6"> </div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
300
src/main/webapp/WEB-INF/views/basics/urlCommGroupFormUpdate.jsp
Normal file
300
src/main/webapp/WEB-INF/views/basics/urlCommGroupFormUpdate.jsp
Normal file
@@ -0,0 +1,300 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="url_group_configuration"></spring:message></title>
|
||||
<script type="text/javascript">
|
||||
$(function(){
|
||||
$("#cfgFrom").validate({
|
||||
errorPlacement: function(error,element){
|
||||
if($(element).parents().hasClass("tagsinput")){
|
||||
$(element).parents(".col-md-6").next("div").append(error);
|
||||
}else{
|
||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||
}
|
||||
},
|
||||
submitHandler: function(form){
|
||||
/* $("[name='country']").val($("[name='userRegion1'] option:selected").attr("country"));
|
||||
$("[name='detail']").val($("[name='userRegion1'] option:selected").attr("detail"));
|
||||
$("[name='asnIpGroup']").val($("[name='userRegion1'] option:selected").attr("asnIpGroup")); */
|
||||
var flag = true;
|
||||
/* $(".boxSolid:visible").find("input[name$='cfgKeywords']").each(function(){
|
||||
if($(this).val()==''){
|
||||
$(this).parents(".form-group").find(
|
||||
"div[for='"
|
||||
+ $(this).attr("name")
|
||||
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$("#keywordError").text()+"</label>");
|
||||
flag = false;
|
||||
}
|
||||
}); */
|
||||
$(".tagsinput:visible").each(function(){
|
||||
var text='';
|
||||
$(this).find(".tag").each(function(){
|
||||
text+=$(this).children("span").text().trim();
|
||||
});
|
||||
if(text.length < 4 || text.length > 1024){
|
||||
$(this).parents(".col-md-6").next("div").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$.validator.messages.keywordLength+"</label>");
|
||||
if(flag){
|
||||
flag=false;
|
||||
}
|
||||
}
|
||||
});
|
||||
if(flag){
|
||||
loading('onloading...');
|
||||
form.submit();
|
||||
}else{
|
||||
return;
|
||||
}
|
||||
|
||||
},
|
||||
errorContainer: "#messageBox",
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
|
||||
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
|
||||
<div class="page-content">
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="url_group_configuration"></spring:message>
|
||||
</h3>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="portlet box blue">
|
||||
<div class="portlet-title">
|
||||
<div class="caption">
|
||||
<i class="fa fa-gift"></i>
|
||||
<spring:message code="edit"></spring:message>
|
||||
</div>
|
||||
</div>
|
||||
<div class="portlet-body form">
|
||||
<!-- BEGIN FORM-->
|
||||
<form id="cfgFrom" action="${ctx}/basics/url/update" method="post" class="form-horizontal">
|
||||
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
|
||||
<input type="hidden" name="regionId" value="${_cfg.regionId}">
|
||||
<input type="hidden" name="compileId" value="${_cfg.compileId}">
|
||||
<input type="hidden" name="functionId" value="${_cfg.functionId}">
|
||||
<input type="hidden" name="isValid" value="${_cfg.isValid}">
|
||||
<input type="hidden" name="isAudit" value="${_cfg.isAudit}">
|
||||
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
|
||||
<input type="hidden" id="isAreaEffective" name="isAreaEffective" value="0">
|
||||
<input type="hidden" id="requestId" name="requestId" value="${_cfg.requestId}">
|
||||
<%-- <input type="hidden" id="protocolId" name="protocolId" value="${_cfg.protocolId}">
|
||||
<input type="hidden" id="asnIpGroup" name="asnIpGroup" value="${_cfg.asnIpGroup}"> --%>
|
||||
<!-- 配置域类型 -->
|
||||
<c:forEach items="${regionList}" var="region">
|
||||
<c:if test="${_cfg.functionId eq region.functionId}">
|
||||
<input type="hidden" name="cfgType" value="${region.configRegionValue}">
|
||||
<input type="hidden" name="cfgRegionCode"
|
||||
isMaat="${region.isMaat}"
|
||||
serviceType="${region.configServiceType}"
|
||||
ipPortShow="${region.configIpPortShow}"
|
||||
ipType="${region.configIpType}"
|
||||
srcIpPattern="${fn:split(region.configIpPattern,';')[0]}"
|
||||
destIpPattern="${fn:split(region.configIpPattern,';')[1]}"
|
||||
srcPortPattern="${fn:split(region.configPortPattern,';')[0]}"
|
||||
destPortPattern="${fn:split(region.configPortPattern,';')[1]}"
|
||||
direction="${region.configDirection}"
|
||||
protocol="${region.configProtocol}"
|
||||
regionType="${region.regionType}"
|
||||
value="${region.configRegionCode}">
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
<div class="form-body">
|
||||
<!-- desc and action -->
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="urlGroup"/></label>
|
||||
<div class="col-md-6">
|
||||
<%-- <input class="form-control required digits asnMustExists" type="text" name="${cfgName}.cfgKeywords" value="${cfg.cfgKeywords}" ctx="${ctx}"> --%>
|
||||
<select name="userRegion3" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||
<option value="${_cfg.userRegion3}"><spring:message code="select"/></option>
|
||||
<c:forEach items="${policyGroupInfos}" var="urlGroupInfo">
|
||||
<option value="${urlGroupInfo.groupId}"
|
||||
<c:if test="${_cfg.userRegion3 eq urlGroupInfo.serviceGroupId }">
|
||||
selected
|
||||
</c:if>
|
||||
>${urlGroupInfo.groupName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
<div for="userRegion3"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- desc and action -->
|
||||
<h4 class="form-section">
|
||||
<spring:message code="http_url_title" />
|
||||
<!-- <small> <span
|
||||
class="glyphicon glyphicon-plus asnIpAdd"
|
||||
onClick="addContent(this,'strInfo')" title="add"></span></small> -->
|
||||
</h4>
|
||||
<!-- <div class="row strInfo boxSolid asnIp hidden disabled"> -->
|
||||
<!-- <input type="hidden" name="asnIpCfgs[0].protocolId" value="0"> -->
|
||||
<!-- <div class="row">
|
||||
<div class="pull-right">
|
||||
<span class="glyphicon glyphicon-remove pull-right" title="remove"
|
||||
onClick="delContent(this,'strInfo');" />
|
||||
</div>
|
||||
</div> -->
|
||||
<div class=" boxSolid ">
|
||||
<div class="row" style="height: 15px;"></div>
|
||||
<c:forEach items="${regionList}" var="region" varStatus="status">
|
||||
<%-- <c:set var="cfgName" value="urlCommGroupList[-1]"></c:set> --%>
|
||||
<%-- <input type="hidden" name="${cfgName}.sourceCompileId" value="${cfg.sourceCompileId }"> --%>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="keywords" />
|
||||
</label>
|
||||
<!-- 此配置的关键词可以输入多个关键词 -->
|
||||
<c:if test="${region.configMultiKeywords eq 1}">
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required tags <c:if test="${fn:containsIgnoreCase(region.configServiceType,'domain') }"> domainCheck </c:if> <c:if test="${fn:containsIgnoreCase(region.configServiceType,'url') }"> urlCheck </c:if>" type="text" id="tags_${tabName}${status.index}"
|
||||
name="cfgKeywords"
|
||||
value="${_cfg.cfgKeywords}">
|
||||
</div>
|
||||
</c:if>
|
||||
<!-- 此配置的关键词不允许输入多个关键词 -->
|
||||
<c:if test="${(region.configMultiKeywords eq 0) or (empty region.configMultiKeywords)}">
|
||||
<div class="col-md-6">
|
||||
<input class="form-control required invisibleChar
|
||||
<c:if test="${fn:containsIgnoreCase(region.configServiceType,'domain') }"> domainCheck </c:if>
|
||||
<c:if test="${fn:containsIgnoreCase(region.configServiceType,'url') }"> urlCheck </c:if>
|
||||
"
|
||||
type="text"
|
||||
name="cfgKeywords"
|
||||
value="${_cfg.cfgKeywords}">
|
||||
</div>
|
||||
</c:if>
|
||||
<div for="cfgKeywords"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-6 exprType">
|
||||
<div class="form-group">
|
||||
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="expression_type" /></label>
|
||||
<div class="col-md-6">
|
||||
<c:if test="${!empty region.configExprType}">
|
||||
<c:forEach var="exprType" items="${fn:split(region.configExprType,',')}" varStatus="stat" >
|
||||
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC" >
|
||||
<c:if test="${exprTypeC.itemCode eq exprType}">
|
||||
<label class="radio-inline">
|
||||
<input type="radio"
|
||||
name="exprType" value="${exprType }"
|
||||
class="required"
|
||||
<%-- <c:if test="${stat.index == 0 }"> checked </c:if> --%>
|
||||
<c:if test="${_cfg.exprType eq exprType || (empty _cfg.exprType && exprType eq 0)}">
|
||||
checked
|
||||
</c:if>
|
||||
>
|
||||
<spring:message code="${exprTypeC.itemValue }" />
|
||||
</label>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
<c:if test="${empty region.configExprType}">
|
||||
<c:forEach items="${fns:getDictList('EXPRESSION_TYPE')}" var="exprTypeC">
|
||||
<c:if test="${exprTypeC.itemCode eq 0}">
|
||||
<label class="radio-inline">
|
||||
<input type="radio"
|
||||
name="exprType" value="${exprTypeC.itemCode }"
|
||||
class="required" checked >
|
||||
<spring:message code="${exprTypeC.itemValue }" />
|
||||
</label>
|
||||
</c:if>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</div>
|
||||
<div for="exprType"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 matchMethod">
|
||||
<div class="form-group ">
|
||||
<label class="control-label col-md-3"><font color="red">*</font>
|
||||
<spring:message code="match_method" /></label>
|
||||
<div class="col-md-6">
|
||||
<select name="matchMethod"
|
||||
class="selectpicker select2 form-control required ">
|
||||
<c:if test="${!empty region.configMatchMethod}">
|
||||
<c:forEach var="matchMethod" items="${fn:split(region.configMatchMethod,',')}">
|
||||
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
|
||||
<c:if test="${matchMethodC.itemCode eq matchMethod}">
|
||||
<option value="${matchMethodC.itemCode}"
|
||||
>
|
||||
<spring:message code="${matchMethodC.itemValue}"/>
|
||||
</option>
|
||||
</c:if>
|
||||
|
||||
</c:forEach>
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
<c:if test="${empty region.configMatchMethod}">
|
||||
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
|
||||
<c:if test="${matchMethodC.itemCode eq 0}">
|
||||
<option value="${matchMethodC.itemCode}"
|
||||
selected
|
||||
>
|
||||
<spring:message code="${matchMethodC.itemValue}"/>
|
||||
</option>
|
||||
</c:if>
|
||||
|
||||
</c:forEach>
|
||||
</c:if>
|
||||
</select>
|
||||
</div>
|
||||
<div for="matchMethod"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</c:forEach>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="form-actions">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="row">
|
||||
<div class="col-md-offset-3 col-md-8">
|
||||
<button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
|
||||
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6"> </div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- END FORM-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
313
src/main/webapp/WEB-INF/views/basics/urlCommGroupList.jsp
Normal file
313
src/main/webapp/WEB-INF/views/basics/urlCommGroupList.jsp
Normal file
@@ -0,0 +1,313 @@
|
||||
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||
<html>
|
||||
<head>
|
||||
<title><spring:message code="url_group_configuration"></spring:message></title>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
//搜索框提示语初始化
|
||||
if("${cfg.cfgDesc}"){
|
||||
$("#intype").val("${cfg.cfgDesc}");
|
||||
}else if("${cfg.compileId}"){
|
||||
$("#intype").val("${cfg.compileId}");
|
||||
}else if("${cfg.cfgKeywords}"){
|
||||
$("#intype").val("${cfg.cfgKeywords}");
|
||||
}else{
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
|
||||
}
|
||||
$("#seltype").change(function(){
|
||||
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
|
||||
});
|
||||
//筛选功能初始化
|
||||
filterActionInit();
|
||||
$("#isAudit").change(function(){
|
||||
page();
|
||||
});
|
||||
//reset
|
||||
$("#resetBtn").on("click",function(){
|
||||
$("select.selectpicker").each(function(){
|
||||
$(this).selectpicker('val',$(this).find('option:first').val());
|
||||
$(this).find("option").attr("selected",false);
|
||||
$(this).find("option:first").attr("selected",true);
|
||||
});
|
||||
$(".Wdate").attr("value",'');
|
||||
$("#description").attr("value",'');
|
||||
$("#searchForm")[0].reset();
|
||||
});
|
||||
|
||||
if($("#exportType").val() != null && $("#exportType").val() != ""){
|
||||
if($("#intype").val() != null && $("#intype").val() != ""){
|
||||
$("#exportValue").val($("#intype").val());
|
||||
}
|
||||
}
|
||||
});
|
||||
var edit=function(url){
|
||||
var cked = $('tbody tr td input.i-checks:checkbox:checked');
|
||||
if(cked.val()==1){
|
||||
top.$.jBox.tip("<spring:message code='has_approved'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
if(cked.length==1){
|
||||
window.location = url+"&compileId="+cked.attr("id");
|
||||
}else{
|
||||
top.$.jBox.tip("<spring:message code='check_one'/>", "<spring:message code='info'/>");
|
||||
return;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="page-content">
|
||||
<div class="theme-panel hidden-xs hidden-sm">
|
||||
<shiro:hasPermission name="asn:ip:config">
|
||||
<button type="button" class="btn btn-primary"
|
||||
onClick="javascript:window.location='${ctx}/basics/url/addForm?functionId=${cfg.functionId}'">
|
||||
<i class="fa fa-plus"></i>
|
||||
<spring:message code="add"></spring:message></button>
|
||||
|
||||
<button type="button" class="btn btn-primary import" >
|
||||
<i class="fa fa-plus"></i>
|
||||
<spring:message code="import"></spring:message></button>
|
||||
|
||||
</shiro:hasPermission>
|
||||
</div>
|
||||
|
||||
<h3 class="page-title">
|
||||
<spring:message code="url_group_configuration"></spring:message>
|
||||
|
||||
</h3>
|
||||
<h5 class="page-header"></h5>
|
||||
<div class="col-md-12">
|
||||
<div class="portlet">
|
||||
<div class="portlet-body">
|
||||
<div class="row" >
|
||||
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/basics/url/list?functionId=${cfg.functionId}" method="post" class="form-search">
|
||||
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
|
||||
<input id="audit" name="audit" type="hidden" value="${audit}"/>
|
||||
<input id="exportType" type="hidden" value="${cfg.seltype}"/>
|
||||
<input id="exportValue" type="hidden" value=""/>
|
||||
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
|
||||
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
|
||||
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}"
|
||||
callback="page();" />
|
||||
<!-- 筛选按钮展开状态-->
|
||||
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${cfg.isFilterAction }"/>
|
||||
<!-- 搜索内容与操作按钮栏 -->
|
||||
<div class="col-md-12">
|
||||
<%-- <div class="pull-left">
|
||||
<form:select path="asnIpGroup" class="selectpicker select2 input-small" data-live-search="true" data-live-search-placeholder="search">
|
||||
<form:option value=""><spring:message code='asn_ip_group'/></form:option>
|
||||
<c:forEach items="${policyGroups}" var="policyGroup">
|
||||
<form:option value="${policyGroup.groupId}"><spring:message code='${policyGroup.groupName}'/></form:option>
|
||||
</c:forEach>
|
||||
</form:select>
|
||||
</div> --%>
|
||||
<div class="pull-left">
|
||||
<c:set var="state"><spring:message code='group'/></c:set>
|
||||
<form:select path="isAudit" class="selectpicker select2 input-small">
|
||||
<form:option value=""><spring:message code="all_states"/></form:option>
|
||||
<form:option value="0"><spring:message code="created"></spring:message></form:option>
|
||||
<form:option value="1"><spring:message code="approved"></spring:message></form:option>
|
||||
<form:option value="2"><spring:message code="unapproved"></spring:message></form:option>
|
||||
<form:option value="3"><spring:message code="cancel_approved"></spring:message></form:option>
|
||||
</form:select>
|
||||
</div>
|
||||
|
||||
<div class="pull-left">
|
||||
|
||||
<div class="input-group">
|
||||
<div class="input-group-btn">
|
||||
|
||||
<form:select path="seltype" class="selectpicker select2 input-small" >
|
||||
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
|
||||
<form:option value="compileId"><spring:message code="cfg_id"></spring:message></form:option>
|
||||
<form:option value="cfgKeywords"><spring:message code="URL"></spring:message></form:option>
|
||||
<%-- <form:option value="action"><spring:message code="block_type"></spring:message></form:option> --%>
|
||||
<form:option value="isValid"><spring:message code="valid_identifier"></spring:message></form:option>
|
||||
</form:select>
|
||||
|
||||
</div>
|
||||
|
||||
<input id="intype" class="form-control input-medium" type="text" value="">
|
||||
<div class="input-group-btn">
|
||||
<form:select path="isValid" class="selectpicker select2 input-small" >
|
||||
<form:option value=""><spring:message code="select"/></form:option>
|
||||
<form:option value="1"><spring:message code="yes"/></form:option>
|
||||
<form:option value="0"><spring:message code="no"/></form:option>
|
||||
</form:select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pull-left">
|
||||
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
|
||||
<button type="button" class="btn btn-default" id="resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
|
||||
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/> <i class="fa fa-angle-double-down"></i></button>
|
||||
</div>
|
||||
<div class="pull-right">
|
||||
<shiro:hasPermission name="http:url:config">
|
||||
<sys:delRow url="${ctx}/basics/url/updateForm?functionId=${cfg.functionId}" id="contentTable" label="update"></sys:delRow>
|
||||
<sys:delRow url="${ctx}/basics/url/delete?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||
</shiro:hasPermission>
|
||||
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="export"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" style="min-width: 110px;" >
|
||||
<li><sys:delRow url="${ctx}/basics/url/exportUrlComm?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/basics/url/list?functionId=${cfg.functionId}" id="contentTable" maxRow="5" label="cfg_excel"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basics/url/exportUrlComm?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/basics/url/list?functionId=${cfg.functionId}" id="contentTable" maxRow="5" label="cfg_csv"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<shiro:hasPermission name="asn:ip:confirm">
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
|
||||
<i class="fa fa-angle-down"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right">
|
||||
<li><sys:delRow url="${ctx}/basics/url/audit?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basics/url/audit?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
|
||||
<li><sys:delRow url="${ctx}/basics/url/audit?isAudit=3&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="cancelPass"></sys:delRow></li>
|
||||
</ul>
|
||||
</div>
|
||||
</shiro:hasPermission>
|
||||
<a class="btn btn-icon-only btn-default setfields tooltips"
|
||||
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
|
||||
<i class="icon-wrench"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /搜索内容与操作按钮栏 -->
|
||||
|
||||
<!-- 筛选搜索内容栏默认隐藏-->
|
||||
<div class="col-md-12 filter-action-select-panle hide" >
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label><spring:message code="config_time"/>:</label>
|
||||
<input name="search_create_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value='${cfg.search_create_time_start}' pattern='yyyy-MM-dd HH:mm:ss'/>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label> </label>
|
||||
<input name="search_create_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${cfg.search_create_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label><spring:message code="edit_time"/>:</label>
|
||||
<input name="search_edit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${cfg.search_edit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label> </label>
|
||||
<input name="search_edit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${cfg.search_edit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label><spring:message code="audit_time"/>:</label>
|
||||
<input name="search_audit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${cfg.search_audit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<div class="form-group">
|
||||
<label> </label>
|
||||
<input name="search_audit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
|
||||
value="<fmt:formatDate value="${cfg.search_audit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- /筛选搜索内容栏 结束-->
|
||||
</form:form>
|
||||
</div>
|
||||
<sys:message content="${message}" type="${messageType }"/>
|
||||
<div class="table-responsive">
|
||||
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||
<th class="sort-column r.compile_id" style="display: none;" column="cfg_id" ><spring:message code="cfg_id"/></th>
|
||||
|
||||
<th column="config_describe" ><spring:message code="config_describe"/></th>
|
||||
<th class="sort-column cfg_keywords">URL<spring:message code="key_word"/></th>
|
||||
<th><spring:message code="is_audit"/></th>
|
||||
<th column="sort-column group_name" ><spring:message code="group_name"/></th>
|
||||
<th column="valid_identifier" ><spring:message code="valid_identifier"/></th>
|
||||
<th column="creator" ><spring:message code="creator"/></th>
|
||||
<th column="config_time" class="sort-column create_time"><spring:message code="config_time"/></th>
|
||||
<th column="editor" ><spring:message code="editor"/></th>
|
||||
<th column="edit_time" class="sort-column edit_time"><spring:message code="edit_time"/></th>
|
||||
<th column="auditor"><spring:message code="auditor"/></th>
|
||||
<th class="sort-column audit_time"><spring:message code="audit_time"/></th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${page.list }" var="cfg" varStatus="status" step="1">
|
||||
<tr>
|
||||
<td><input type="checkbox" class="i-checks" id="${cfg.cfgId}" isValid="${cfg.isValid}" value="${cfg.isAudit}"></td>
|
||||
<td>${cfg.compileId }</td>
|
||||
<td>${cfg.cfgDesc }</td>
|
||||
<td>${cfg.cfgKeywords }</td>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${cfg.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
|
||||
<c:when test="${cfg.isAudit eq '1'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:when>
|
||||
<c:when test="${cfg.isAudit eq '2'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:when>
|
||||
<c:when test="${cfg.isAudit eq '3'}"><span class="label label-warning"><spring:message code="cancel_approved"></spring:message></span></c:when>
|
||||
</c:choose>
|
||||
</td>
|
||||
<td>${cfg.groupName }</td>
|
||||
<td>
|
||||
<c:if test="${cfg.isValid==0}"><spring:message code="no"/></c:if>
|
||||
<c:if test="${cfg.isValid==1}"><spring:message code="yes"/></c:if>
|
||||
<c:if test="${cfg.isValid==-1}"><spring:message code="deleted"/></c:if>
|
||||
</td>
|
||||
<td>${cfg.creatorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${cfg.editorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
<td>${cfg.auditorName }</td>
|
||||
<td><fmt:formatDate value="${cfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
|
||||
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="page">${page}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<c:set var="importPath" value="/basics/url/list?functionId=${cfg.functionId}"/>
|
||||
<!-- 模板导入,start -->
|
||||
<%@include file="/WEB-INF/include/excel/importModal.jsp" %>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user