1、增加SubscribeId分组配置功能 2、增加公共分组相关国际化代码及相关sql文件修改
This commit is contained in:
58
src/main/java/com/nis/domain/basics/DomainCommCfg.java
Normal file
58
src/main/java/com/nis/domain/basics/DomainCommCfg.java
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
package com.nis.domain.basics;
|
||||||
|
|
||||||
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
public class DomainCommCfg extends BaseStringCfg<DomainCommCfg>{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 5117517145731135023L;
|
||||||
|
private static final String tableName="domain_comm_cfg";
|
||||||
|
|
||||||
|
@ExcelField(title="key_word",sort=3)
|
||||||
|
protected String cfgKeywords;
|
||||||
|
|
||||||
|
protected Integer isHexbin;
|
||||||
|
|
||||||
|
protected String ratelimit;
|
||||||
|
|
||||||
|
@ExcelField(title="group_name",sort=2)
|
||||||
|
protected String groupName;//公共组名称
|
||||||
|
|
||||||
|
@ExcelField(title="match_method",dictType="MATCH_METHOD",sort=20)
|
||||||
|
protected Integer matchMethod ;
|
||||||
|
|
||||||
|
public String getCfgKeywords() {
|
||||||
|
return cfgKeywords;
|
||||||
|
}
|
||||||
|
public void setCfgKeywords(String cfgKeywords) {
|
||||||
|
this.cfgKeywords = cfgKeywords;
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
public Integer getMatchMethod() {
|
||||||
|
return matchMethod;
|
||||||
|
}
|
||||||
|
public void setMatchMethod(Integer matchMethod) {
|
||||||
|
this.matchMethod = matchMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -48,7 +48,7 @@ public class IpCommCfg extends BaseCfg<IpCommCfg> {
|
|||||||
protected Integer dnsStrategyId;
|
protected Integer dnsStrategyId;
|
||||||
@ExcelField(title="ir_type",dictType="IR_TYPE",sort=57)
|
@ExcelField(title="ir_type",dictType="IR_TYPE",sort=57)
|
||||||
protected Integer irType;
|
protected Integer irType;
|
||||||
@ExcelField(title="group_name",sort=58)
|
@ExcelField(title="group_name",sort=45)
|
||||||
protected String groupName;
|
protected String groupName;
|
||||||
// @ExcelField(title="log_total",sort=42)
|
// @ExcelField(title="log_total",sort=42)
|
||||||
private Long totalLogs;
|
private Long totalLogs;
|
||||||
|
|||||||
58
src/main/java/com/nis/domain/basics/ScriberIdCommCfg.java
Normal file
58
src/main/java/com/nis/domain/basics/ScriberIdCommCfg.java
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
package com.nis.domain.basics;
|
||||||
|
|
||||||
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
public class ScriberIdCommCfg extends BaseStringCfg<ScriberIdCommCfg>{
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 5117517145731135023L;
|
||||||
|
private static final String tableName="scriberid_comm_cfg";
|
||||||
|
|
||||||
|
@ExcelField(title="key_word",sort=3)
|
||||||
|
protected String cfgKeywords;
|
||||||
|
|
||||||
|
protected Integer isHexbin;
|
||||||
|
|
||||||
|
protected String ratelimit;
|
||||||
|
|
||||||
|
@ExcelField(title="group_name",sort=2)
|
||||||
|
protected String groupName;//公共组名称
|
||||||
|
|
||||||
|
@ExcelField(title="match_method",dictType="MATCH_METHOD",sort=20)
|
||||||
|
protected Integer matchMethod ;
|
||||||
|
|
||||||
|
public String getCfgKeywords() {
|
||||||
|
return cfgKeywords;
|
||||||
|
}
|
||||||
|
public void setCfgKeywords(String cfgKeywords) {
|
||||||
|
this.cfgKeywords = cfgKeywords;
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
public Integer getMatchMethod() {
|
||||||
|
return matchMethod;
|
||||||
|
}
|
||||||
|
public void setMatchMethod(Integer matchMethod) {
|
||||||
|
this.matchMethod = matchMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -6,19 +6,18 @@ import com.nis.util.excel.ExcelField;
|
|||||||
public class UrlCommCfg extends BaseStringCfg<UrlCommCfg>{
|
public class UrlCommCfg extends BaseStringCfg<UrlCommCfg>{
|
||||||
|
|
||||||
private static final long serialVersionUID = 398247881810945300L;
|
private static final long serialVersionUID = 398247881810945300L;
|
||||||
private static final String tableName="http_url_cfg";
|
private static final String tableName="url_comm_cfg";
|
||||||
|
|
||||||
@ExcelField(title="key_word",sort=3)
|
@ExcelField(title="key_word",sort=3)
|
||||||
protected String cfgKeywords;//url关键字配置
|
protected String cfgKeywords;//url关键字配置
|
||||||
|
|
||||||
// protected Integer exprType;//表达式类型
|
|
||||||
// protected Integer matchMethod;//匹配类型
|
|
||||||
protected Integer isHexbin;//是否大小写敏感
|
protected Integer isHexbin;//是否大小写敏感
|
||||||
protected String ratelimit;//限速比例,0到1之间
|
protected String ratelimit;//限速比例,0到1之间
|
||||||
@ExcelField(title="group_name",sort=108)
|
@ExcelField(title="group_name",sort=2)
|
||||||
protected String groupName;//公共组名称
|
protected String groupName;//公共组名称
|
||||||
|
|
||||||
|
@ExcelField(title="match_method",dictType="MATCH_METHOD",sort=20)
|
||||||
|
protected Integer matchMethod ;
|
||||||
|
|
||||||
public String getCfgKeywords() {
|
public String getCfgKeywords() {
|
||||||
return cfgKeywords;
|
return cfgKeywords;
|
||||||
@@ -26,18 +25,6 @@ public class UrlCommCfg extends BaseStringCfg<UrlCommCfg>{
|
|||||||
public void setCfgKeywords(String cfgKeywords) {
|
public void setCfgKeywords(String cfgKeywords) {
|
||||||
this.cfgKeywords = 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() {
|
public Integer getIsHexbin() {
|
||||||
return isHexbin;
|
return isHexbin;
|
||||||
}
|
}
|
||||||
@@ -60,5 +47,11 @@ public class UrlCommCfg extends BaseStringCfg<UrlCommCfg>{
|
|||||||
public void setGroupName(String groupName) {
|
public void setGroupName(String groupName) {
|
||||||
this.groupName = groupName;
|
this.groupName = groupName;
|
||||||
}
|
}
|
||||||
|
public Integer getMatchMethod() {
|
||||||
|
return matchMethod;
|
||||||
|
}
|
||||||
|
public void setMatchMethod(Integer matchMethod) {
|
||||||
|
this.matchMethod = matchMethod;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -80,19 +80,19 @@ public class BaseCfg<T> extends BaseEntity<T> implements Cloneable{
|
|||||||
private String commonGroupIds; //公共组织id(考虑一个compile存在多个asn组织的情况)
|
private String commonGroupIds; //公共组织id(考虑一个compile存在多个asn组织的情况)
|
||||||
protected Integer groupType; //url组以及dns组相关功能使用
|
protected Integer groupType; //url组以及dns组相关功能使用
|
||||||
protected Integer udFlag; //url组以及dns组相关功能使用 过滤数据库数据标记
|
protected Integer udFlag; //url组以及dns组相关功能使用 过滤数据库数据标记
|
||||||
|
|
||||||
|
public String getCommonGroupIds() {
|
||||||
|
return commonGroupIds;
|
||||||
|
}
|
||||||
|
public void setCommonGroupIds(String commonGroupIds) {
|
||||||
|
this.commonGroupIds = commonGroupIds;
|
||||||
|
}
|
||||||
public Integer getGroupType() {
|
public Integer getGroupType() {
|
||||||
return groupType;
|
return groupType;
|
||||||
}
|
}
|
||||||
public void setGroupType(Integer groupType) {
|
public void setGroupType(Integer groupType) {
|
||||||
this.groupType = groupType;
|
this.groupType = groupType;
|
||||||
}
|
}
|
||||||
public String getCommonGroupIds() {
|
|
||||||
return commonGroupIds;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCommonGroupIds(String commonGroupIds) {
|
|
||||||
this.commonGroupIds = commonGroupIds;
|
|
||||||
}
|
|
||||||
public Integer getUdFlag() {
|
public Integer getUdFlag() {
|
||||||
return udFlag;
|
return udFlag;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,8 +14,10 @@ import java.util.Map;
|
|||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
import com.nis.domain.basics.AsnGroupInfo;
|
import com.nis.domain.basics.AsnGroupInfo;
|
||||||
import com.nis.domain.basics.AsnIpCfg;
|
import com.nis.domain.basics.AsnIpCfg;
|
||||||
|
import com.nis.domain.basics.DomainCommCfg;
|
||||||
import com.nis.domain.basics.IpCommCfg;
|
import com.nis.domain.basics.IpCommCfg;
|
||||||
import com.nis.domain.basics.IpReuseIpCfg;
|
import com.nis.domain.basics.IpReuseIpCfg;
|
||||||
|
import com.nis.domain.basics.ScriberIdCommCfg;
|
||||||
import com.nis.domain.basics.UrlCommCfg;
|
import com.nis.domain.basics.UrlCommCfg;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.excel.ExcelField;
|
import com.nis.util.excel.ExcelField;
|
||||||
@@ -92,6 +94,9 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
|||||||
private Long totalLogs;
|
private Long totalLogs;
|
||||||
private List<UrlCommCfg> urlCommGroupList;
|
private List<UrlCommCfg> urlCommGroupList;
|
||||||
private List<IpCommCfg> ipCommGroupCfgList;
|
private List<IpCommCfg> ipCommGroupCfgList;
|
||||||
|
private List<DomainCommCfg> domainCommGroupList;
|
||||||
|
private List<ScriberIdCommCfg> scriberIdCommGroupList;
|
||||||
|
|
||||||
/*private CachePolicyUserRegion cachePolicyUserRegion;//缓存策略用户自定义域参数
|
/*private CachePolicyUserRegion cachePolicyUserRegion;//缓存策略用户自定义域参数
|
||||||
|
|
||||||
public static class CachePolicyUserRegion{
|
public static class CachePolicyUserRegion{
|
||||||
@@ -426,4 +431,19 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
|||||||
this.urlCommGroupList = urlCommGroupList;
|
this.urlCommGroupList = urlCommGroupList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<DomainCommCfg> getDomainCommGroupList() {
|
||||||
|
return domainCommGroupList;
|
||||||
|
}
|
||||||
|
public void setDomainCommGroupList(List<DomainCommCfg> domainCommGroupList) {
|
||||||
|
this.domainCommGroupList = domainCommGroupList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ScriberIdCommCfg> getScriberIdCommGroupList() {
|
||||||
|
return scriberIdCommGroupList;
|
||||||
|
}
|
||||||
|
public void setScriberIdCommGroupList(List<ScriberIdCommCfg> scriberIdCommGroupList) {
|
||||||
|
this.scriberIdCommGroupList = scriberIdCommGroupList;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 域名公共组配置 导入模板
|
||||||
|
* @author dell
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class DomainCommCfgTemplate extends StringAllNotDoLogTemplate{
|
||||||
|
|
||||||
|
@ExcelField(title="group_name",align=2,sort=10)
|
||||||
|
private Integer groupId;
|
||||||
|
|
||||||
|
public Integer getGroupId() {
|
||||||
|
return groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupId(Integer groupId) {
|
||||||
|
this.groupId = groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -3,7 +3,7 @@ package com.nis.domain.configuration.template;
|
|||||||
import com.nis.util.excel.ExcelField;
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
public class IpCommCfgTemplate extends IpAllNotDoLogTemplate{
|
public class IpCommCfgTemplate extends IpAllNotDoLogTemplate{
|
||||||
@ExcelField(title="ip_group",align=2,sort=10)
|
@ExcelField(title="group_name",align=2,sort=10)
|
||||||
private Integer groupId;
|
private Integer groupId;
|
||||||
|
|
||||||
public Integer getGroupId() {
|
public Integer getGroupId() {
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 域名公共组配置 导入模板
|
||||||
|
* @author dell
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class ScriberIdCommCfgTemplate extends StringAllNotDoLogTemplate{
|
||||||
|
|
||||||
|
@ExcelField(title="group_name",align=2,sort=10)
|
||||||
|
private Integer groupId;
|
||||||
|
|
||||||
|
public Integer getGroupId() {
|
||||||
|
return groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGroupId(Integer groupId) {
|
||||||
|
this.groupId = groupId;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -9,7 +9,7 @@ import com.nis.util.excel.ExcelField;
|
|||||||
*/
|
*/
|
||||||
public class UrlCommCfgTemplate extends StringAllNotDoLogTemplate{
|
public class UrlCommCfgTemplate extends StringAllNotDoLogTemplate{
|
||||||
|
|
||||||
@ExcelField(title="url_group",align=2,sort=10)
|
@ExcelField(title="group_name",align=2,sort=10)
|
||||||
private Integer groupId;
|
private Integer groupId;
|
||||||
|
|
||||||
public Integer getGroupId() {
|
public Integer getGroupId() {
|
||||||
|
|||||||
@@ -192,6 +192,22 @@ public final class Constants {
|
|||||||
* DNS 策略组KEY
|
* DNS 策略组KEY
|
||||||
*/
|
*/
|
||||||
public static final String CACHE_DNSGROUP_DICT = "dnsGroupDict";
|
public static final String CACHE_DNSGROUP_DICT = "dnsGroupDict";
|
||||||
|
/**
|
||||||
|
* IP公共组缓存KEY
|
||||||
|
*/
|
||||||
|
public static final String CACHE_IPGROUP_DICT = "ipComGroupDict";
|
||||||
|
/**
|
||||||
|
* URL公共组缓存KEY
|
||||||
|
*/
|
||||||
|
public static final String CACHE_URLGROUP_DICT = "urlComGroupDict";
|
||||||
|
/**
|
||||||
|
* Domain公共组缓存KEY
|
||||||
|
*/
|
||||||
|
public static final String CACHE_DOMAINGROUP_DICT = "domainComGroupDict";
|
||||||
|
/**
|
||||||
|
* ScriberId公共组缓存KEY
|
||||||
|
*/
|
||||||
|
public static final String CACHE_SCRIBERGROUP_DICT = "scriberComGroupDict";
|
||||||
/**
|
/**
|
||||||
* 词典数据分类
|
* 词典数据分类
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -14,12 +14,14 @@ import com.nis.domain.FunctionRegionDict;
|
|||||||
import com.nis.domain.FunctionServiceDict;
|
import com.nis.domain.FunctionServiceDict;
|
||||||
import com.nis.domain.SysDataDictionaryItem;
|
import com.nis.domain.SysDataDictionaryItem;
|
||||||
import com.nis.domain.SysDataDictionaryName;
|
import com.nis.domain.SysDataDictionaryName;
|
||||||
|
import com.nis.domain.basics.CommonGroupInfo;
|
||||||
import com.nis.domain.basics.PolicyGroupInfo;
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
import com.nis.domain.basics.SysDictInfo;
|
import com.nis.domain.basics.SysDictInfo;
|
||||||
import com.nis.domain.configuration.DnsResStrategy;
|
import com.nis.domain.configuration.DnsResStrategy;
|
||||||
import com.nis.web.dao.FunctionRegionDictDao;
|
import com.nis.web.dao.FunctionRegionDictDao;
|
||||||
import com.nis.web.dao.FunctionServiceDictDao;
|
import com.nis.web.dao.FunctionServiceDictDao;
|
||||||
import com.nis.web.dao.SysDictDao;
|
import com.nis.web.dao.SysDictDao;
|
||||||
|
import com.nis.web.dao.basics.CommonGroupManageDao;
|
||||||
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||||
import com.nis.web.dao.basics.SysDictInfoDao;
|
import com.nis.web.dao.basics.SysDictInfoDao;
|
||||||
import com.nis.web.dao.configuration.DnsResStrategyDao;
|
import com.nis.web.dao.configuration.DnsResStrategyDao;
|
||||||
@@ -42,6 +44,7 @@ public class DictUtils {
|
|||||||
private final static FunctionServiceDictDao functionServiceDictDao = SpringContextHolder.getBean(FunctionServiceDictDao.class);
|
private final static FunctionServiceDictDao functionServiceDictDao = SpringContextHolder.getBean(FunctionServiceDictDao.class);
|
||||||
private final static DnsResStrategyDao dnsResStrategyDao = SpringContextHolder.getBean(DnsResStrategyDao.class);
|
private final static DnsResStrategyDao dnsResStrategyDao = SpringContextHolder.getBean(DnsResStrategyDao.class);
|
||||||
private final static PolicyGroupInfoDao policyGroupInfoDao = SpringContextHolder.getBean(PolicyGroupInfoDao.class);
|
private final static PolicyGroupInfoDao policyGroupInfoDao = SpringContextHolder.getBean(PolicyGroupInfoDao.class);
|
||||||
|
private final static CommonGroupManageDao commonGroupManageDao = SpringContextHolder.getBean(CommonGroupManageDao.class);
|
||||||
|
|
||||||
public static Map<String, List<SysDataDictionaryItem>> getDictData() {
|
public static Map<String, List<SysDataDictionaryItem>> getDictData() {
|
||||||
|
|
||||||
@@ -401,4 +404,38 @@ public class DictUtils {
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取公共组字典缓存
|
||||||
|
*/
|
||||||
|
public static List<CommonGroupInfo> getCommonGroups(Integer groupType){
|
||||||
|
String dictKey = Constants.CACHE_IPGROUP_DICT;
|
||||||
|
if(groupType.equals(7)) {
|
||||||
|
dictKey = Constants.CACHE_URLGROUP_DICT;
|
||||||
|
}else if(groupType.equals(8)) {
|
||||||
|
dictKey = Constants.CACHE_DOMAINGROUP_DICT;
|
||||||
|
}else if(groupType.equals(9)) {
|
||||||
|
dictKey = Constants.CACHE_SCRIBERGROUP_DICT;
|
||||||
|
}
|
||||||
|
List<CommonGroupInfo> allDictList = (List<CommonGroupInfo>)CacheUtils.get(dictKey);
|
||||||
|
if(StringUtil.isEmpty(allDictList)){
|
||||||
|
allDictList = commonGroupManageDao.findCommonGroupInfosByType(groupType);
|
||||||
|
CacheUtils.put(dictKey, allDictList);
|
||||||
|
}
|
||||||
|
|
||||||
|
return allDictList;
|
||||||
|
}
|
||||||
|
public static CommonGroupInfo getCommonGroups(Integer groupId, Integer groupType){
|
||||||
|
List<CommonGroupInfo> allDictList = getCommonGroups(groupType);
|
||||||
|
if(StringUtil.isEmpty(allDictList)){
|
||||||
|
}else {
|
||||||
|
for(CommonGroupInfo group:allDictList) {
|
||||||
|
if(group.getServiceGroupId().equals(groupId)) {
|
||||||
|
return group;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -465,10 +465,19 @@ public class ExportExcel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if("ip_group".equals(headerStr)) {
|
// IP、URL、Domain和ScriberId公共组
|
||||||
|
if("group_name".equals(headerStr)) {
|
||||||
commentStr="";
|
commentStr="";
|
||||||
//查询dns fake ip policyGroup列表
|
List<PolicyGroupInfo> list = null;
|
||||||
List<PolicyGroupInfo> list=policyGroupInfoDao.findPolicyGroupInfosByType(5);
|
if(region.getFunctionId().equals(605)) {
|
||||||
|
list=policyGroupInfoDao.findPolicyGroupInfosByType(5);
|
||||||
|
}else if(region.getFunctionId().equals(606)) {
|
||||||
|
list=policyGroupInfoDao.findPolicyGroupInfosByType(7);
|
||||||
|
}else if(region.getFunctionId().equals(607)) {
|
||||||
|
list=policyGroupInfoDao.findPolicyGroupInfosByType(8);
|
||||||
|
}else if(region.getFunctionId().equals(608)) {
|
||||||
|
list=policyGroupInfoDao.findPolicyGroupInfosByType(9);
|
||||||
|
}
|
||||||
if(!StringUtil.isEmpty(list)){
|
if(!StringUtil.isEmpty(list)){
|
||||||
for (PolicyGroupInfo policyGroupInfo : list) {
|
for (PolicyGroupInfo policyGroupInfo : list) {
|
||||||
commentStr=commentStr+policyGroupInfo.getServiceGroupId()+"("+policyGroupInfo.getGroupName()+")\n";
|
commentStr=commentStr+policyGroupInfo.getServiceGroupId()+"("+policyGroupInfo.getGroupName()+")\n";
|
||||||
@@ -1807,7 +1816,7 @@ public class ExportExcel {
|
|||||||
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
index++;
|
index++;
|
||||||
//2、默认值说明
|
//2、默认值说明
|
||||||
if(region.getFunctionId().equals(200)) {
|
if(region.getFunctionId().equals(200) || region.getFunctionId().equals(607)) {
|
||||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":1\n";
|
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":1\n";
|
||||||
}else {
|
}else {
|
||||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":0\n";
|
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":0\n";
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import com.nis.domain.FunctionRegionDict;
|
|||||||
import com.nis.domain.FunctionServiceDict;
|
import com.nis.domain.FunctionServiceDict;
|
||||||
import com.nis.domain.SysDataDictionaryItem;
|
import com.nis.domain.SysDataDictionaryItem;
|
||||||
import com.nis.domain.basics.AsnGroupInfo;
|
import com.nis.domain.basics.AsnGroupInfo;
|
||||||
|
import com.nis.domain.basics.CommonGroupInfo;
|
||||||
import com.nis.domain.basics.PolicyGroupInfo;
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
import com.nis.domain.callback.ProxyFileTrafficMirrorCfg;
|
import com.nis.domain.callback.ProxyFileTrafficMirrorCfg;
|
||||||
import com.nis.domain.configuration.BaseIpCfg;
|
import com.nis.domain.configuration.BaseIpCfg;
|
||||||
@@ -33,6 +34,7 @@ import com.nis.util.Constants;
|
|||||||
import com.nis.util.DictUtils;
|
import com.nis.util.DictUtils;
|
||||||
import com.nis.util.IPUtil;
|
import com.nis.util.IPUtil;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
|
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||||
import com.nis.web.dao.configuration.ProxyFileTrafficMirrorDao;
|
import com.nis.web.dao.configuration.ProxyFileTrafficMirrorDao;
|
||||||
import com.nis.web.dao.configuration.PxyObjKeyringDao;
|
import com.nis.web.dao.configuration.PxyObjKeyringDao;
|
||||||
import com.nis.web.service.BaseService;
|
import com.nis.web.service.BaseService;
|
||||||
@@ -50,6 +52,8 @@ public class CheckIpFormatThread implements Callable<String>{
|
|||||||
private Map<Long,AsnGroupInfo> asnGroupInfos;
|
private Map<Long,AsnGroupInfo> asnGroupInfos;
|
||||||
private static PxyObjKeyringDao pxyObjKeyringDao = SpringContextHolder.getBean(PxyObjKeyringDao.class);
|
private static PxyObjKeyringDao pxyObjKeyringDao = SpringContextHolder.getBean(PxyObjKeyringDao.class);
|
||||||
private static ProxyFileTrafficMirrorDao proxyFileDao = SpringContextHolder.getBean(ProxyFileTrafficMirrorDao.class);
|
private static ProxyFileTrafficMirrorDao proxyFileDao = SpringContextHolder.getBean(ProxyFileTrafficMirrorDao.class);
|
||||||
|
private static PolicyGroupInfoDao policyGroupInfoDao = SpringContextHolder.getBean(PolicyGroupInfoDao.class);
|
||||||
|
|
||||||
// private DnsResStrategyDao dnsResStrategyDao;
|
// private DnsResStrategyDao dnsResStrategyDao;
|
||||||
public CheckIpFormatThread(FunctionServiceDict serviceDict,FunctionRegionDict regionDict,Properties prop,BlockingQueue<? extends Object> srcQueue,BlockingQueue<BaseIpCfg> destQueue) {
|
public CheckIpFormatThread(FunctionServiceDict serviceDict,FunctionRegionDict regionDict,Properties prop,BlockingQueue<? extends Object> srcQueue,BlockingQueue<BaseIpCfg> destQueue) {
|
||||||
this.serviceDict=serviceDict;
|
this.serviceDict=serviceDict;
|
||||||
@@ -832,6 +836,19 @@ public class CheckIpFormatThread implements Callable<String>{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IP公共组配置
|
||||||
|
if(regionDict.getFunctionId().equals(605)) {
|
||||||
|
Integer groupId = baseIpCfg.getGroupId();
|
||||||
|
if (groupId != null) {
|
||||||
|
CommonGroupInfo groupInfo = DictUtils.getCommonGroups(groupId, 5);
|
||||||
|
if (groupInfo == null) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("group_name"))+ ";");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("group_name") + " ") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (regionDict.getRegionType().equals(1)) {
|
if (regionDict.getRegionType().equals(1)) {
|
||||||
boolean srcIpEmpty = false;
|
boolean srcIpEmpty = false;
|
||||||
boolean destIpEmpty = false;
|
boolean destIpEmpty = false;
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ import com.beust.jcommander.internal.Sets;
|
|||||||
import com.nis.domain.FunctionRegionDict;
|
import com.nis.domain.FunctionRegionDict;
|
||||||
import com.nis.domain.FunctionServiceDict;
|
import com.nis.domain.FunctionServiceDict;
|
||||||
import com.nis.domain.SysDataDictionaryItem;
|
import com.nis.domain.SysDataDictionaryItem;
|
||||||
|
import com.nis.domain.basics.CommonGroupInfo;
|
||||||
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
import com.nis.domain.callback.ProxyFileTrafficMirrorCfg;
|
import com.nis.domain.callback.ProxyFileTrafficMirrorCfg;
|
||||||
import com.nis.domain.configuration.BaseStringCfg;
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
import com.nis.domain.configuration.PxyObjKeyring;
|
import com.nis.domain.configuration.PxyObjKeyring;
|
||||||
@@ -131,6 +133,41 @@ public class CheckStringFormatThread implements Callable<String>{
|
|||||||
// doLog属性检验
|
// doLog属性检验
|
||||||
this.validDoLog(baseStringCfg,errInfo);
|
this.validDoLog(baseStringCfg,errInfo);
|
||||||
|
|
||||||
|
// URL、Domain、ScriberId公共组配置
|
||||||
|
if(regionDict.getFunctionId().equals(606)) {
|
||||||
|
Integer groupId = baseStringCfg.getGroupId();
|
||||||
|
if (groupId != null) {
|
||||||
|
CommonGroupInfo groupInfo = DictUtils.getCommonGroups(groupId, 7);
|
||||||
|
if (groupInfo == null) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("group_name"))+ ";");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("group_name") + " ") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(regionDict.getFunctionId().equals(607)) {
|
||||||
|
Integer groupId = baseStringCfg.getGroupId();
|
||||||
|
if (groupId != null) {
|
||||||
|
CommonGroupInfo groupInfo = DictUtils.getCommonGroups(groupId, 8);
|
||||||
|
if (groupInfo == null) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("group_name"))+ ";");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("group_name") + " ") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(regionDict.getFunctionId().equals(608)) {
|
||||||
|
Integer groupId = baseStringCfg.getGroupId();
|
||||||
|
if (groupId != null) {
|
||||||
|
CommonGroupInfo groupInfo = DictUtils.getCommonGroups(groupId, 9);
|
||||||
|
if (groupInfo == null) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("group_name"))+ ";");
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
errInfo.append(String.format(prop.getProperty("can_not_null"), prop.getProperty("group_name") + " ") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (regionDict.getRegionType().equals(2)) {
|
if (regionDict.getRegionType().equals(2)) {
|
||||||
if (regionDict.getFunctionId().equals(510) && "p2p_hash".equals(regionDict.getConfigServiceType())) {
|
if (regionDict.getFunctionId().equals(510) && "p2p_hash".equals(regionDict.getConfigServiceType())) {
|
||||||
String userRegion1 = baseStringCfg.getUserRegion1();
|
String userRegion1 = baseStringCfg.getUserRegion1();
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ import com.nis.domain.configuration.template.DnsComplexStringTemplate;
|
|||||||
import com.nis.domain.configuration.template.DnsFakeIpTemplate;
|
import com.nis.domain.configuration.template.DnsFakeIpTemplate;
|
||||||
import com.nis.domain.configuration.template.DnsIpTemplate;
|
import com.nis.domain.configuration.template.DnsIpTemplate;
|
||||||
import com.nis.domain.configuration.template.DnsResStrategyTemplate;
|
import com.nis.domain.configuration.template.DnsResStrategyTemplate;
|
||||||
|
import com.nis.domain.configuration.template.DomainCommCfgTemplate;
|
||||||
import com.nis.domain.configuration.template.DomainInterceptMonitTemplate;
|
import com.nis.domain.configuration.template.DomainInterceptMonitTemplate;
|
||||||
import com.nis.domain.configuration.template.DomainInterceptRateLimitTemplate;
|
import com.nis.domain.configuration.template.DomainInterceptRateLimitTemplate;
|
||||||
import com.nis.domain.configuration.template.DomainInterceptTemplate;
|
import com.nis.domain.configuration.template.DomainInterceptTemplate;
|
||||||
@@ -107,15 +108,18 @@ import com.nis.domain.configuration.template.InterceptDomainTemplate;
|
|||||||
import com.nis.domain.configuration.template.InterceptIpTemplate;
|
import com.nis.domain.configuration.template.InterceptIpTemplate;
|
||||||
import com.nis.domain.configuration.template.IpAllNotDoLogTemplate;
|
import com.nis.domain.configuration.template.IpAllNotDoLogTemplate;
|
||||||
import com.nis.domain.configuration.template.IpAllTemplate;
|
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.IpPayloadTemplate;
|
||||||
import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
||||||
import com.nis.domain.configuration.template.IpSpoofingTemplate;
|
import com.nis.domain.configuration.template.IpSpoofingTemplate;
|
||||||
import com.nis.domain.configuration.template.IpWhitelistTemplate;
|
import com.nis.domain.configuration.template.IpWhitelistTemplate;
|
||||||
import com.nis.domain.configuration.template.P2pHashStringTemplate;
|
import com.nis.domain.configuration.template.P2pHashStringTemplate;
|
||||||
import com.nis.domain.configuration.template.P2pIpTemplate;
|
import com.nis.domain.configuration.template.P2pIpTemplate;
|
||||||
|
import com.nis.domain.configuration.template.ScriberIdCommCfgTemplate;
|
||||||
import com.nis.domain.configuration.template.StringAllNotDoLogTemplate;
|
import com.nis.domain.configuration.template.StringAllNotDoLogTemplate;
|
||||||
import com.nis.domain.configuration.template.StringAllTemplate;
|
import com.nis.domain.configuration.template.StringAllTemplate;
|
||||||
import com.nis.domain.configuration.template.TopicWebsiteTemplate;
|
import com.nis.domain.configuration.template.TopicWebsiteTemplate;
|
||||||
|
import com.nis.domain.configuration.template.UrlCommCfgTemplate;
|
||||||
import com.nis.domain.log.BaseLogEntity;
|
import com.nis.domain.log.BaseLogEntity;
|
||||||
import com.nis.domain.log.SearchReport;
|
import com.nis.domain.log.SearchReport;
|
||||||
import com.nis.domain.maat.MaatCfg;
|
import com.nis.domain.maat.MaatCfg;
|
||||||
@@ -2545,7 +2549,10 @@ public class BaseController {
|
|||||||
ei.loadInitParams(IpAllNotDoLogTemplate.class, msgProp, regionDict, serviceDict);
|
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
|
} 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);
|
ei.loadInitParams(IpRateLimitTemplate.class, msgProp, regionDict, serviceDict);
|
||||||
}else {
|
} else if(regionDict.getFunctionId().equals(605)){ // IP Common Group
|
||||||
|
ei.loadInitParams(IpCommCfgTemplate.class, msgProp, regionDict, serviceDict);
|
||||||
|
}
|
||||||
|
else {
|
||||||
ei.loadInitParams(IpAllTemplate.class, msgProp, regionDict, serviceDict);
|
ei.loadInitParams(IpAllTemplate.class, msgProp, regionDict, serviceDict);
|
||||||
}
|
}
|
||||||
} else if (regionDict.getRegionType().equals(2)) {// 字符串类
|
} else if (regionDict.getRegionType().equals(2)) {// 字符串类
|
||||||
@@ -2583,6 +2590,12 @@ public class BaseController {
|
|||||||
ei.loadInitParams(StringAllNotDoLogTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
ei.loadInitParams(StringAllNotDoLogTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
}else if(regionDict.getFunctionId().equals(560)){// 主题网站
|
}else if(regionDict.getFunctionId().equals(560)){// 主题网站
|
||||||
ei.loadInitParams(TopicWebsiteTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
ei.loadInitParams(TopicWebsiteTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getFunctionId().equals(606)){// URL Common Group
|
||||||
|
ei.loadInitParams(UrlCommCfgTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getFunctionId().equals(607)){// 域名 Common Group
|
||||||
|
ei.loadInitParams(DomainCommCfgTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getFunctionId().equals(608)){// 账号 Common Group
|
||||||
|
ei.loadInitParams(ScriberIdCommCfgTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
}else {
|
}else {
|
||||||
ei.loadInitParams(StringAllTemplate.class, msgProp, regionDict, serviceDict);
|
ei.loadInitParams(StringAllTemplate.class, msgProp, regionDict, serviceDict);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,9 +71,9 @@ public class CommonGroupManageController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value={"delete"})
|
@RequestMapping(value={"delete"})
|
||||||
public String delete(RedirectAttributes redirectAttributes, Integer groupType,String ids,int isValid,HttpServletRequest request) {
|
public String delete(RedirectAttributes redirectAttributes, String groupTypes, String ids, int isValid,HttpServletRequest request) {
|
||||||
try {
|
try {
|
||||||
commonGroupManageService.deldete(ids,isValid);
|
commonGroupManageService.deldete(ids, isValid, groupTypes);
|
||||||
addMessage(redirectAttributes,"success","delete_success");
|
addMessage(redirectAttributes,"success","delete_success");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("删除失败",e);
|
logger.error("删除失败",e);
|
||||||
|
|||||||
@@ -0,0 +1,302 @@
|
|||||||
|
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.jets3t.service.ServiceException;
|
||||||
|
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.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.CommonGroupInfo;
|
||||||
|
import com.nis.domain.basics.DomainCommCfg;
|
||||||
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
|
import com.nis.domain.configuration.template.DomainCommCfgTemplate;
|
||||||
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.ConfigServiceUtil;
|
||||||
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.util.DictUtils;
|
||||||
|
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.DomainCommGroupService;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping(value = "${adminPath}/basics/domain")
|
||||||
|
public class DomainCommGroupController extends BaseController{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DomainCommGroupService domainCommGroupService;
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/list"})
|
||||||
|
public String list(Model model, @ModelAttribute("cfg")DomainCommCfg entity, HttpServletRequest request,HttpServletResponse response){
|
||||||
|
Page<DomainCommCfg> page = domainCommGroupService.findPage(new Page<DomainCommCfg>(request, response,"r"), entity);
|
||||||
|
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||||
|
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
||||||
|
List<CommonGroupInfo> groupInfos = commonGroupManageService.findCommonGroupInfosByType(8);
|
||||||
|
|
||||||
|
model.addAttribute("page", page);
|
||||||
|
model.addAttribute("regionList", regionList);
|
||||||
|
model.addAttribute("serviceList", serviceList);
|
||||||
|
model.addAttribute("policyGroupInfos", groupInfos);
|
||||||
|
return "/basics/domainCommGroupList";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/addForm"})
|
||||||
|
public String addForm(Model model, @ModelAttribute("cfg")CfgIndexInfo cfg, RedirectAttributes redirectAttributes,
|
||||||
|
HttpServletRequest request, HttpServletResponse response){
|
||||||
|
initFormCondition(model,cfg);
|
||||||
|
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(8);
|
||||||
|
model.addAttribute("policyGroupInfos", groupInfos);
|
||||||
|
|
||||||
|
model.addAttribute("_cfg", cfg);
|
||||||
|
return "/basics/domainCommGroupFormAdd";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/save"})
|
||||||
|
public String save(Model model, @ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes,
|
||||||
|
HttpServletRequest request,HttpServletResponse response){
|
||||||
|
try{
|
||||||
|
domainCommGroupService.saveCommGroupCfg(cfg);
|
||||||
|
addMessage(redirectAttributes,"success","save_success");
|
||||||
|
}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/domain/list?functionId="+cfg.getFunctionId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/updateForm"})
|
||||||
|
public String updateForm(Model model,HttpServletRequest request
|
||||||
|
,HttpServletResponse response,String ids,@ModelAttribute("cfg")DomainCommCfg cfg
|
||||||
|
,RedirectAttributes redirectAttributes){
|
||||||
|
cfg = domainCommGroupService.get(Long.parseLong(ids));
|
||||||
|
initUpdateFormCondition(model,cfg);
|
||||||
|
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(8);
|
||||||
|
model.addAttribute("policyGroupInfos", groupInfos);
|
||||||
|
model.addAttribute("_cfg", cfg);
|
||||||
|
return "/basics/domainCommGroupFormUpdate";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/update"})
|
||||||
|
public String update(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")DomainCommCfg cfg,RedirectAttributes redirectAttributes){
|
||||||
|
try{
|
||||||
|
domainCommGroupService.update(cfg);
|
||||||
|
addMessage(redirectAttributes,"success","save_success");
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.error("信息保存失败",e);
|
||||||
|
addMessage(redirectAttributes,"error","save_failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
return "redirect:" + adminPath +"/basics/domain/list?functionId="+cfg.getFunctionId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/delete"})
|
||||||
|
public String delete(String compileIds, String ids, Integer functionId, RedirectAttributes redirectAttributes){
|
||||||
|
try{
|
||||||
|
domainCommGroupService.delete(ids,compileIds);
|
||||||
|
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/domain/list?functionId="+functionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 数据导入
|
||||||
|
@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<BaseStringCfg<?>> stringCfgs =null;
|
||||||
|
|
||||||
|
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(2)) {
|
||||||
|
BlockingQueue<DomainCommCfgTemplate> list = ei.getDataList(DomainCommCfgTemplate.class );
|
||||||
|
stringCfgs = this.checkStringCfgMulity(errTip, serviceDict, regionDict, 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(2)) {
|
||||||
|
List<BaseStringCfg<?>> _stringCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
while(!stringCfgs.isEmpty()) {
|
||||||
|
stringCfgs.drainTo(_stringCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
|
||||||
|
List<Integer> regionIds = Lists.newArrayList(_stringCfgs.size());
|
||||||
|
try {
|
||||||
|
regionIds = ConfigServiceUtil.getId(3,_stringCfgs.size());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info("获取域ID出错");
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
int index = 0;
|
||||||
|
for (BaseStringCfg<?> cfg : _stringCfgs) {
|
||||||
|
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
||||||
|
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||||
|
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||||
|
cfg.setCreateTime(date);
|
||||||
|
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||||
|
//cfg.setDoLog(2);
|
||||||
|
cfg.setCompileId(0);
|
||||||
|
cfg.setFunctionId(regionDict.getFunctionId());
|
||||||
|
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("domain_comm_cfg");
|
||||||
|
cfg.setRegionId(regionIds.get(index));
|
||||||
|
index++;
|
||||||
|
|
||||||
|
}
|
||||||
|
domainCommGroupService.saveAndSend(regionDict, serviceDict, _stringCfgs);
|
||||||
|
_stringCfgs.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 = "/exportGroupInfo")
|
||||||
|
public void exportGroupInfo(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||||
|
@ModelAttribute("cfg")DomainCommCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||||
|
try {
|
||||||
|
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<DomainCommCfg> list = new ArrayList<DomainCommCfg>();
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
|
list = domainCommGroupService.findByPage(ids);
|
||||||
|
} else {
|
||||||
|
Page<DomainCommCfg> pageInfo=new Page<DomainCommCfg>(request, response,"r");
|
||||||
|
pageInfo.setPageNo(1);
|
||||||
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
|
Page<DomainCommCfg> page = domainCommGroupService.findPage(pageInfo, entity);
|
||||||
|
list=page.getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
CommonGroupInfo groupInfo = new CommonGroupInfo();
|
||||||
|
for (DomainCommCfg cfg : list) {
|
||||||
|
groupInfo.setServiceGroupId(cfg.getGroupId());
|
||||||
|
CommonGroupInfo commonGroupInfo = commonGroupManageService.getGroupInfo(groupInfo);
|
||||||
|
cfg.setGroupName(commonGroupInfo.getGroupName());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
titleList.add(entity.getMenuNameCode());
|
||||||
|
classMap.put(entity.getMenuNameCode(), DomainCommCfg.class);
|
||||||
|
String cfgIndexInfoNoExport=",block_type,do_log,action,letter,whether_area_block,classification,attribute,label"
|
||||||
|
+ ",expression_type,userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,asn_no,"
|
||||||
|
+ "is_hex,is_case_insenstive,cfg_id,is_audit,auditor,valid_identifier,";
|
||||||
|
// 时间过滤
|
||||||
|
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("domainGroupConfig export failed",e);
|
||||||
|
addMessage(redirectAttributes,"error","export_failed");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -33,6 +33,7 @@ import com.nis.domain.configuration.CfgIndexInfo;
|
|||||||
import com.nis.domain.configuration.IpPortCfg;
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
import com.nis.domain.configuration.template.IpCommCfgTemplate;
|
import com.nis.domain.configuration.template.IpCommCfgTemplate;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.ConfigServiceUtil;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.DictUtils;
|
import com.nis.util.DictUtils;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
@@ -159,11 +160,20 @@ public class IpCommGroupController extends BaseController {
|
|||||||
Page<IpCommCfg> page = ipCommGroupCfgService.findPage(pageInfo, entity);
|
Page<IpCommCfg> page = ipCommGroupCfgService.findPage(pageInfo, entity);
|
||||||
list = page.getList();
|
list = page.getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CommonGroupInfo groupInfo = new CommonGroupInfo();
|
||||||
|
for (IpCommCfg cfg : list) {
|
||||||
|
groupInfo.setServiceGroupId(cfg.getGroupId());
|
||||||
|
CommonGroupInfo commonGroupInfo = commonGroupManageService.getGroupInfo(groupInfo);
|
||||||
|
cfg.setGroupName(commonGroupInfo.getGroupName());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
classMap.put(entity.getMenuNameCode(), IpPortCfg.class);
|
classMap.put(entity.getMenuNameCode(), IpCommCfg.class);
|
||||||
String cfgIndexInfoNoExport = ",block_type,do_log,action"
|
String cfgIndexInfoNoExport = ",block_type,do_log,action"
|
||||||
+ ",letter,whether_area_block,classification,attribute,label"
|
+ ",letter,whether_area_block,classification,attribute,label,userregion1,userregion2,userregion3,userregion4,userregion5"
|
||||||
+ ",userregion1,userregion2,userregion3,userregion4,userregion5,src_ip_pattern,client_ip,src_port_pattern,client_port,dest_ip_pattern,dest_port_pattern,dest_port,";
|
+ ",src_ip_pattern,src_port_pattern,client_port,dest_ip_pattern,dest_port_pattern,server_port,cfg_id,is_audit,auditor,valid_identifier,ir_type,";
|
||||||
// 时间过滤
|
// 时间过滤
|
||||||
if (entity.getSearch_create_time_start() == null) {
|
if (entity.getSearch_create_time_start() == null) {
|
||||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
@@ -199,6 +209,7 @@ public class IpCommGroupController extends BaseController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 数据导入
|
||||||
@RequestMapping(value = "import", method=RequestMethod.POST)
|
@RequestMapping(value = "import", method=RequestMethod.POST)
|
||||||
public String importIp(HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
public String importIp(HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
||||||
@RequestParam("files") MultipartFile[] files, Integer serviceDictId ,Integer requestId ,String attribute ,String classify
|
@RequestParam("files") MultipartFile[] files, Integer serviceDictId ,Integer requestId ,String attribute ,String classify
|
||||||
@@ -210,7 +221,7 @@ public class IpCommGroupController extends BaseController {
|
|||||||
FunctionServiceDict serviceDict = DictUtils.getFunctionServiceDict(serviceDictId);
|
FunctionServiceDict serviceDict = DictUtils.getFunctionServiceDict(serviceDictId);
|
||||||
StringBuffer errTip=new StringBuffer();
|
StringBuffer errTip=new StringBuffer();
|
||||||
BlockingQueue<BaseIpCfg> ipPortCfgs =null;
|
BlockingQueue<BaseIpCfg> ipPortCfgs =null;
|
||||||
//List<CfgIndexInfo> cfgIndexInfos = new ArrayList<CfgIndexInfo>();
|
|
||||||
for (int i = 0; i < files.length; i++) {
|
for (int i = 0; i < files.length; i++) {
|
||||||
MultipartFile file = files[i];
|
MultipartFile file = files[i];
|
||||||
ei = new ImportBigExcel(file, 0, 1);
|
ei = new ImportBigExcel(file, 0, 1);
|
||||||
@@ -234,8 +245,16 @@ public class IpCommGroupController extends BaseController {
|
|||||||
List<BaseIpCfg> _ipPortCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
List<BaseIpCfg> _ipPortCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||||
while(!ipPortCfgs.isEmpty()) {
|
while(!ipPortCfgs.isEmpty()) {
|
||||||
ipPortCfgs.drainTo(_ipPortCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
ipPortCfgs.drainTo(_ipPortCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
List<Integer> regionIds = Lists.newArrayList(_ipPortCfgs.size());
|
||||||
|
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;
|
int index = 0;
|
||||||
for (BaseIpCfg cfg : _ipPortCfgs) {
|
for (BaseIpCfg cfg : _ipPortCfgs) {
|
||||||
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
||||||
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||||
@@ -245,15 +264,8 @@ public class IpCommGroupController extends BaseController {
|
|||||||
//cfg.setDoLog(2);
|
//cfg.setDoLog(2);
|
||||||
cfg.setCompileId(0);
|
cfg.setCompileId(0);
|
||||||
cfg.setFunctionId(regionDict.getFunctionId());
|
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);
|
|
||||||
}else {
|
|
||||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||||
cfg.setIsValid(Constants.VALID_NO);
|
cfg.setIsValid(Constants.VALID_NO);
|
||||||
}
|
|
||||||
cfg.setIsAreaEffective(0);
|
cfg.setIsAreaEffective(0);
|
||||||
cfg.setLable("0");
|
cfg.setLable("0");
|
||||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||||
@@ -261,9 +273,11 @@ public class IpCommGroupController extends BaseController {
|
|||||||
cfg.setClassify(classify);
|
cfg.setClassify(classify);
|
||||||
cfg.setServiceId(serviceDict==null?null:serviceDict.getServiceId());
|
cfg.setServiceId(serviceDict==null?null:serviceDict.getServiceId());
|
||||||
cfg.setTableName("ip_comm_cfg");
|
cfg.setTableName("ip_comm_cfg");
|
||||||
ind++;
|
cfg.setRegionId(regionIds.get(index));
|
||||||
|
index++;
|
||||||
|
|
||||||
}
|
}
|
||||||
ipCommGroupCfgService.saveAndSend(regionDict, serviceDict, _ipPortCfgs,isSend.equals("1"));
|
ipCommGroupCfgService.saveAndSend(regionDict, serviceDict, _ipPortCfgs);
|
||||||
_ipPortCfgs.clear();
|
_ipPortCfgs.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -294,16 +308,4 @@ public class IpCommGroupController extends BaseController {
|
|||||||
return "redirect:" + adminPath+ importPath;
|
return "redirect:" + adminPath+ importPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@ResponseBody
|
|
||||||
@RequestMapping(value="ajaxGetGroups",method=RequestMethod.POST)
|
|
||||||
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.findPolicyByGroupInfoList(groupIds);
|
|
||||||
for(PolicyGroupInfo p:list) {
|
|
||||||
groupIdList.put(p.getGroupId(), p.getGroupName());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return groupIdList;
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,302 @@
|
|||||||
|
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.jets3t.service.ServiceException;
|
||||||
|
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.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.CommonGroupInfo;
|
||||||
|
import com.nis.domain.basics.ScriberIdCommCfg;
|
||||||
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
|
import com.nis.domain.configuration.template.ScriberIdCommCfgTemplate;
|
||||||
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.ConfigServiceUtil;
|
||||||
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.util.DictUtils;
|
||||||
|
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.ScriberIdCommGroupService;
|
||||||
|
|
||||||
|
@Controller
|
||||||
|
@RequestMapping(value = "${adminPath}/basics/scriberId")
|
||||||
|
public class ScriberIdCommGroupController extends BaseController{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ScriberIdCommGroupService scriberIdCommGroupService;
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/list"})
|
||||||
|
public String list(Model model, @ModelAttribute("cfg")ScriberIdCommCfg entity, HttpServletRequest request,HttpServletResponse response){
|
||||||
|
Page<ScriberIdCommCfg> page = scriberIdCommGroupService.findPage(new Page<ScriberIdCommCfg>(request, response,"r"), entity);
|
||||||
|
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
|
||||||
|
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entity.getFunctionId());
|
||||||
|
List<CommonGroupInfo> groupInfos = commonGroupManageService.findCommonGroupInfosByType(9);
|
||||||
|
|
||||||
|
model.addAttribute("page", page);
|
||||||
|
model.addAttribute("regionList", regionList);
|
||||||
|
model.addAttribute("serviceList", serviceList);
|
||||||
|
model.addAttribute("policyGroupInfos", groupInfos);
|
||||||
|
return "/basics/scriberidCommGroupList";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/addForm"})
|
||||||
|
public String addForm(Model model, @ModelAttribute("cfg")CfgIndexInfo cfg, RedirectAttributes redirectAttributes,
|
||||||
|
HttpServletRequest request, HttpServletResponse response){
|
||||||
|
initFormCondition(model,cfg);
|
||||||
|
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(9);
|
||||||
|
model.addAttribute("policyGroupInfos", groupInfos);
|
||||||
|
|
||||||
|
model.addAttribute("_cfg", cfg);
|
||||||
|
return "/basics/scriberidCommGroupFormAdd";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/save"})
|
||||||
|
public String save(Model model, @ModelAttribute("cfg")CfgIndexInfo cfg,RedirectAttributes redirectAttributes,
|
||||||
|
HttpServletRequest request,HttpServletResponse response){
|
||||||
|
try{
|
||||||
|
scriberIdCommGroupService.saveCommGroupCfg(cfg);
|
||||||
|
addMessage(redirectAttributes,"success","save_success");
|
||||||
|
}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/scriberId/list?functionId="+cfg.getFunctionId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/updateForm"})
|
||||||
|
public String updateForm(Model model,HttpServletRequest request
|
||||||
|
,HttpServletResponse response,String ids,@ModelAttribute("cfg")ScriberIdCommCfg cfg
|
||||||
|
,RedirectAttributes redirectAttributes){
|
||||||
|
cfg = scriberIdCommGroupService.get(Long.parseLong(ids));
|
||||||
|
initUpdateFormCondition(model,cfg);
|
||||||
|
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(9);
|
||||||
|
model.addAttribute("policyGroupInfos", groupInfos);
|
||||||
|
model.addAttribute("_cfg", cfg);
|
||||||
|
return "/basics/scriberidCommGroupFormUpdate";
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/update"})
|
||||||
|
public String update(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")ScriberIdCommCfg cfg,RedirectAttributes redirectAttributes){
|
||||||
|
try{
|
||||||
|
scriberIdCommGroupService.update(cfg);
|
||||||
|
addMessage(redirectAttributes,"success","save_success");
|
||||||
|
}catch(Exception e){
|
||||||
|
logger.error("信息保存失败",e);
|
||||||
|
addMessage(redirectAttributes,"error","save_failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
return "redirect:" + adminPath +"/basics/scriberId/list?functionId="+cfg.getFunctionId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@RequestMapping(value = {"/delete"})
|
||||||
|
public String delete(String compileIds, String ids, Integer functionId, RedirectAttributes redirectAttributes){
|
||||||
|
try{
|
||||||
|
scriberIdCommGroupService.delete(ids,compileIds);
|
||||||
|
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/scriberId/list?functionId="+functionId;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 数据导入
|
||||||
|
@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<BaseStringCfg<?>> stringCfgs =null;
|
||||||
|
|
||||||
|
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(2)) {
|
||||||
|
BlockingQueue<ScriberIdCommCfgTemplate> list = ei.getDataList(ScriberIdCommCfgTemplate.class );
|
||||||
|
stringCfgs = this.checkStringCfgMulity(errTip, serviceDict, regionDict, 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(2)) {
|
||||||
|
List<BaseStringCfg<?>> _stringCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
while(!stringCfgs.isEmpty()) {
|
||||||
|
stringCfgs.drainTo(_stringCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
|
||||||
|
List<Integer> regionIds = Lists.newArrayList(_stringCfgs.size());
|
||||||
|
try {
|
||||||
|
regionIds = ConfigServiceUtil.getId(3,_stringCfgs.size());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info("获取域ID出错");
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
int index = 0;
|
||||||
|
for (BaseStringCfg<?> cfg : _stringCfgs) {
|
||||||
|
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
||||||
|
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||||
|
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||||
|
cfg.setCreateTime(date);
|
||||||
|
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||||
|
//cfg.setDoLog(2);
|
||||||
|
cfg.setCompileId(0);
|
||||||
|
cfg.setFunctionId(regionDict.getFunctionId());
|
||||||
|
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("scriberid_comm_cfg");
|
||||||
|
cfg.setRegionId(regionIds.get(index));
|
||||||
|
index++;
|
||||||
|
|
||||||
|
}
|
||||||
|
scriberIdCommGroupService.saveAndSend(regionDict, serviceDict, _stringCfgs);
|
||||||
|
_stringCfgs.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 = "/exportGroupInfo")
|
||||||
|
public void exportGroupInfo(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||||
|
@ModelAttribute("cfg")ScriberIdCommCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||||
|
try {
|
||||||
|
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<ScriberIdCommCfg> list = new ArrayList<ScriberIdCommCfg>();
|
||||||
|
if (!StringUtil.isEmpty(ids)) {
|
||||||
|
list = scriberIdCommGroupService.findByPage(ids);
|
||||||
|
} else {
|
||||||
|
Page<ScriberIdCommCfg> pageInfo=new Page<ScriberIdCommCfg>(request, response,"r");
|
||||||
|
pageInfo.setPageNo(1);
|
||||||
|
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||||
|
Page<ScriberIdCommCfg> page = scriberIdCommGroupService.findPage(pageInfo, entity);
|
||||||
|
list=page.getList();
|
||||||
|
}
|
||||||
|
|
||||||
|
CommonGroupInfo groupInfo = new CommonGroupInfo();
|
||||||
|
for (ScriberIdCommCfg cfg : list) {
|
||||||
|
groupInfo.setServiceGroupId(cfg.getGroupId());
|
||||||
|
CommonGroupInfo commonGroupInfo = commonGroupManageService.getGroupInfo(groupInfo);
|
||||||
|
cfg.setGroupName(commonGroupInfo.getGroupName());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
titleList.add(entity.getMenuNameCode());
|
||||||
|
classMap.put(entity.getMenuNameCode(), ScriberIdCommCfg.class);
|
||||||
|
String cfgIndexInfoNoExport=",block_type,do_log,action,letter,whether_area_block,classification,attribute,label"
|
||||||
|
+ ",expression_type,userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,asn_no,"
|
||||||
|
+ "is_hex,is_case_insenstive,cfg_id,is_audit,auditor,valid_identifier,";
|
||||||
|
// 时间过滤
|
||||||
|
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("scriberidGroupConfig export failed",e);
|
||||||
|
addMessage(redirectAttributes,"error","export_failed");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,31 +1,43 @@
|
|||||||
package com.nis.web.controller.basics;
|
package com.nis.web.controller.basics;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.concurrent.BlockingQueue;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.jets3t.service.ServiceException;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
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.multipart.MultipartFile;
|
||||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||||
|
|
||||||
|
import com.beust.jcommander.internal.Lists;
|
||||||
import com.nis.domain.FunctionRegionDict;
|
import com.nis.domain.FunctionRegionDict;
|
||||||
import com.nis.domain.FunctionServiceDict;
|
import com.nis.domain.FunctionServiceDict;
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.basics.CommonGroupInfo;
|
import com.nis.domain.basics.CommonGroupInfo;
|
||||||
import com.nis.domain.basics.UrlCommCfg;
|
import com.nis.domain.basics.UrlCommCfg;
|
||||||
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
import com.nis.domain.configuration.CfgIndexInfo;
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
|
import com.nis.domain.configuration.template.UrlCommCfgTemplate;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.ConfigServiceUtil;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.DictUtils;
|
import com.nis.util.DictUtils;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
|
import com.nis.util.excel.ImportBigExcel;
|
||||||
import com.nis.web.controller.BaseController;
|
import com.nis.web.controller.BaseController;
|
||||||
|
import com.nis.web.security.UserUtils;
|
||||||
import com.nis.web.service.basics.UrlCommGroupService;
|
import com.nis.web.service.basics.UrlCommGroupService;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@@ -52,7 +64,6 @@ public class UrlCommGroupController extends BaseController{
|
|||||||
@RequestMapping(value = {"/addForm"})
|
@RequestMapping(value = {"/addForm"})
|
||||||
public String addForm(Model model, @ModelAttribute("cfg")CfgIndexInfo cfg, RedirectAttributes redirectAttributes,
|
public String addForm(Model model, @ModelAttribute("cfg")CfgIndexInfo cfg, RedirectAttributes redirectAttributes,
|
||||||
HttpServletRequest request, HttpServletResponse response){
|
HttpServletRequest request, HttpServletResponse response){
|
||||||
cfg.setGroupType(11);
|
|
||||||
initFormCondition(model,cfg);
|
initFormCondition(model,cfg);
|
||||||
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(7);
|
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(7);
|
||||||
model.addAttribute("policyGroupInfos", groupInfos);
|
model.addAttribute("policyGroupInfos", groupInfos);
|
||||||
@@ -84,7 +95,6 @@ public class UrlCommGroupController extends BaseController{
|
|||||||
,HttpServletResponse response,String ids,@ModelAttribute("cfg")UrlCommCfg cfg
|
,HttpServletResponse response,String ids,@ModelAttribute("cfg")UrlCommCfg cfg
|
||||||
,RedirectAttributes redirectAttributes){
|
,RedirectAttributes redirectAttributes){
|
||||||
cfg = urlCommGroupService.get(Long.parseLong(ids));
|
cfg = urlCommGroupService.get(Long.parseLong(ids));
|
||||||
cfg.setGroupType(11);
|
|
||||||
initUpdateFormCondition(model,cfg);
|
initUpdateFormCondition(model,cfg);
|
||||||
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(7);
|
List<CommonGroupInfo> groupInfos=commonGroupManageService.findCommonGroupInfosByType(7);
|
||||||
model.addAttribute("policyGroupInfos", groupInfos);
|
model.addAttribute("policyGroupInfos", groupInfos);
|
||||||
@@ -122,6 +132,106 @@ public class UrlCommGroupController extends BaseController{
|
|||||||
return "redirect:" + adminPath +"/basics/url/list?functionId="+functionId;
|
return "redirect:" + adminPath +"/basics/url/list?functionId="+functionId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 数据导入
|
||||||
|
@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<BaseStringCfg<?>> stringCfgs =null;
|
||||||
|
|
||||||
|
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(2)) {
|
||||||
|
BlockingQueue<UrlCommCfgTemplate> list = ei.getDataList(UrlCommCfgTemplate.class );
|
||||||
|
stringCfgs = this.checkStringCfgMulity(errTip, serviceDict, regionDict, 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(2)) {
|
||||||
|
List<BaseStringCfg<?>> _stringCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
while(!stringCfgs.isEmpty()) {
|
||||||
|
stringCfgs.drainTo(_stringCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
|
||||||
|
List<Integer> regionIds = Lists.newArrayList(_stringCfgs.size());
|
||||||
|
try {
|
||||||
|
regionIds = ConfigServiceUtil.getId(3,_stringCfgs.size());
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info("获取域ID出错");
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
int index = 0;
|
||||||
|
for (BaseStringCfg<?> cfg : _stringCfgs) {
|
||||||
|
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
||||||
|
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||||
|
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||||
|
cfg.setCreateTime(date);
|
||||||
|
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||||
|
//cfg.setDoLog(2);
|
||||||
|
cfg.setCompileId(0);
|
||||||
|
cfg.setFunctionId(regionDict.getFunctionId());
|
||||||
|
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("url_comm_cfg");
|
||||||
|
cfg.setRegionId(regionIds.get(index));
|
||||||
|
index++;
|
||||||
|
|
||||||
|
}
|
||||||
|
urlCommGroupService.saveAndSend(regionDict, serviceDict, _stringCfgs);
|
||||||
|
_stringCfgs.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 = "/exportUrlComm")
|
@RequestMapping(value = "/exportUrlComm")
|
||||||
public void exportUrlComm(Model model,HttpServletRequest request,HttpServletResponse response,
|
public void exportUrlComm(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||||
@@ -142,11 +252,19 @@ public class UrlCommGroupController extends BaseController{
|
|||||||
list=page.getList();
|
list=page.getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CommonGroupInfo groupInfo = new CommonGroupInfo();
|
||||||
|
for (UrlCommCfg cfg : list) {
|
||||||
|
groupInfo.setServiceGroupId(cfg.getGroupId());
|
||||||
|
CommonGroupInfo commonGroupInfo = commonGroupManageService.getGroupInfo(groupInfo);
|
||||||
|
cfg.setGroupName(commonGroupInfo.getGroupName());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
titleList.add(entity.getMenuNameCode());
|
titleList.add(entity.getMenuNameCode());
|
||||||
classMap.put(entity.getMenuNameCode(), UrlCommCfg.class);
|
classMap.put(entity.getMenuNameCode(), UrlCommCfg.class);
|
||||||
String cfgIndexInfoNoExport=",block_type,do_log,action"
|
String cfgIndexInfoNoExport=",block_type,do_log,action,letter,whether_area_block,classification,attribute,label"
|
||||||
+ ",letter,whether_area_block,classification,attribute,label,expression_type,match_method"
|
+ ",expression_type,userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,asn_no,"
|
||||||
+",userregion1,userregion2,userregion3,userregion4,userregion5,ir_type,asn_no,is_hex,is_case_insenstive,";
|
+ "is_hex,is_case_insenstive,cfg_id,is_audit,auditor,valid_identifier,";
|
||||||
// 时间过滤
|
// 时间过滤
|
||||||
if (entity.getSearch_create_time_start() == null ) {
|
if (entity.getSearch_create_time_start() == null ) {
|
||||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||||
|
|||||||
@@ -41,6 +41,7 @@ import com.nis.domain.configuration.template.DnsComplexStringTemplate;
|
|||||||
import com.nis.domain.configuration.template.DnsFakeIpTemplate;
|
import com.nis.domain.configuration.template.DnsFakeIpTemplate;
|
||||||
import com.nis.domain.configuration.template.DnsIpTemplate;
|
import com.nis.domain.configuration.template.DnsIpTemplate;
|
||||||
import com.nis.domain.configuration.template.DnsResStrategyTemplate;
|
import com.nis.domain.configuration.template.DnsResStrategyTemplate;
|
||||||
|
import com.nis.domain.configuration.template.DomainCommCfgTemplate;
|
||||||
import com.nis.domain.configuration.template.DomainInterceptMonitTemplate;
|
import com.nis.domain.configuration.template.DomainInterceptMonitTemplate;
|
||||||
import com.nis.domain.configuration.template.DomainInterceptRateLimitTemplate;
|
import com.nis.domain.configuration.template.DomainInterceptRateLimitTemplate;
|
||||||
import com.nis.domain.configuration.template.DomainInterceptTemplate;
|
import com.nis.domain.configuration.template.DomainInterceptTemplate;
|
||||||
@@ -57,16 +58,19 @@ import com.nis.domain.configuration.template.InterceptDomainTemplate;
|
|||||||
import com.nis.domain.configuration.template.InterceptIpTemplate;
|
import com.nis.domain.configuration.template.InterceptIpTemplate;
|
||||||
import com.nis.domain.configuration.template.IpAllNotDoLogTemplate;
|
import com.nis.domain.configuration.template.IpAllNotDoLogTemplate;
|
||||||
import com.nis.domain.configuration.template.IpAllTemplate;
|
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.IpPayloadTemplate;
|
||||||
import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
||||||
import com.nis.domain.configuration.template.IpSpoofingTemplate;
|
import com.nis.domain.configuration.template.IpSpoofingTemplate;
|
||||||
import com.nis.domain.configuration.template.IpWhitelistTemplate;
|
import com.nis.domain.configuration.template.IpWhitelistTemplate;
|
||||||
import com.nis.domain.configuration.template.P2pHashStringTemplate;
|
import com.nis.domain.configuration.template.P2pHashStringTemplate;
|
||||||
import com.nis.domain.configuration.template.P2pIpTemplate;
|
import com.nis.domain.configuration.template.P2pIpTemplate;
|
||||||
|
import com.nis.domain.configuration.template.ScriberIdCommCfgTemplate;
|
||||||
import com.nis.domain.configuration.template.SnatTemplate;
|
import com.nis.domain.configuration.template.SnatTemplate;
|
||||||
import com.nis.domain.configuration.template.StringAllNotDoLogTemplate;
|
import com.nis.domain.configuration.template.StringAllNotDoLogTemplate;
|
||||||
import com.nis.domain.configuration.template.StringAllTemplate;
|
import com.nis.domain.configuration.template.StringAllTemplate;
|
||||||
import com.nis.domain.configuration.template.TopicWebsiteTemplate;
|
import com.nis.domain.configuration.template.TopicWebsiteTemplate;
|
||||||
|
import com.nis.domain.configuration.template.UrlCommCfgTemplate;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.util.Constants;
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.DictUtils;
|
import com.nis.util.DictUtils;
|
||||||
@@ -507,6 +511,11 @@ public class IpController extends BaseController{
|
|||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpRateLimitTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpRateLimitTemplate.class, 2);
|
||||||
excel.setDataList(pro,classList,null).
|
excel.setDataList(pro,classList,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(605)){// IP Common Group
|
||||||
|
List<IpCommCfgTemplate> classList=new ArrayList<IpCommCfgTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, IpCommCfgTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
}else{
|
}else{
|
||||||
List<IpAllTemplate> classList=new ArrayList<IpAllTemplate>();
|
List<IpAllTemplate> classList=new ArrayList<IpAllTemplate>();
|
||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpAllTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, IpAllTemplate.class, 2);
|
||||||
@@ -591,6 +600,21 @@ public class IpController extends BaseController{
|
|||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, TopicWebsiteTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, TopicWebsiteTemplate.class, 2);
|
||||||
excel.setDataList(pro,classList,null).
|
excel.setDataList(pro,classList,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(606)) {// URL Common Group
|
||||||
|
List<UrlCommCfgTemplate> classList=new ArrayList<UrlCommCfgTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, UrlCommCfgTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(607)) {// Domain Common Group
|
||||||
|
List<DomainCommCfgTemplate> classList=new ArrayList<DomainCommCfgTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, DomainCommCfgTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(608)) {// ScriberId Common Group
|
||||||
|
List<ScriberIdCommCfgTemplate> classList=new ArrayList<ScriberIdCommCfgTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, ScriberIdCommCfgTemplate.class, 2);
|
||||||
|
excel.setDataList(pro,classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
}else{
|
}else{
|
||||||
List<StringAllTemplate> classList=new ArrayList<StringAllTemplate>();
|
List<StringAllTemplate> classList=new ArrayList<StringAllTemplate>();
|
||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, StringAllTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, StringAllTemplate.class, 2);
|
||||||
|
|||||||
@@ -20,4 +20,6 @@ public interface CommonGroupManageDao extends CrudDao<CommonGroupInfo> {
|
|||||||
|
|
||||||
void updateGroupStatus(@Param("serviceGroupId")String serviceGroupId, @Param("udFlag")Integer udFlag, @Param("groupType")Integer groupType);
|
void updateGroupStatus(@Param("serviceGroupId")String serviceGroupId, @Param("udFlag")Integer udFlag, @Param("groupType")Integer groupType);
|
||||||
|
|
||||||
|
CommonGroupInfo getGroupInfo(CommonGroupInfo searchCfg);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -181,4 +181,29 @@
|
|||||||
WHERE
|
WHERE
|
||||||
service_group_id IN (${serviceGroupId}) AND group_type = #{groupType}
|
service_group_id IN (${serviceGroupId}) AND group_type = #{groupType}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<select id="getGroupInfo" resultType="com.nis.domain.basics.CommonGroupInfo">
|
||||||
|
SELECT
|
||||||
|
<include refid="CommonGroupInfoColumns"/>
|
||||||
|
FROM
|
||||||
|
policy_group_info r
|
||||||
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||||
|
<if test="groupName != null and groupName != ''" >
|
||||||
|
AND group_name = #{groupName,jdbcType=VARCHAR}
|
||||||
|
</if>
|
||||||
|
<if test="groupType != null" >
|
||||||
|
AND group_type = #{groupType,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="serviceGroupId != null" >
|
||||||
|
AND service_group_id = #{serviceGroupId,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="isValid != null" >
|
||||||
|
AND is_valid = #{isValid,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
<if test="isValid == null" >
|
||||||
|
AND is_valid != -1
|
||||||
|
</if>
|
||||||
|
</trim>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
36
src/main/java/com/nis/web/dao/basics/DomainCommGroupDao.java
Normal file
36
src/main/java/com/nis/web/dao/basics/DomainCommGroupDao.java
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
package com.nis.web.dao.basics;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import com.nis.domain.basics.DomainCommCfg;
|
||||||
|
import com.nis.web.dao.CrudDao;
|
||||||
|
import com.nis.web.dao.MyBatisDao;
|
||||||
|
|
||||||
|
@MyBatisDao
|
||||||
|
public interface DomainCommGroupDao extends CrudDao<DomainCommCfg>{
|
||||||
|
|
||||||
|
// 查询列表
|
||||||
|
public List<DomainCommCfg> findAllPageList(DomainCommCfg entity);
|
||||||
|
public List<DomainCommCfg> findByPage(@Param("ids")String ids);
|
||||||
|
|
||||||
|
public List<DomainCommCfg> findInfoByCfgId(@Param("cfgId")Long cfgId);
|
||||||
|
|
||||||
|
//新增
|
||||||
|
public int insertCommGroupCfg(DomainCommCfg entity);
|
||||||
|
|
||||||
|
//修改
|
||||||
|
public int update(DomainCommCfg entity);
|
||||||
|
|
||||||
|
//删除
|
||||||
|
public int delete(@Param("ids")String ids);
|
||||||
|
|
||||||
|
public List<DomainCommCfg> getByIds(@Param("ids")String ids);
|
||||||
|
|
||||||
|
|
||||||
|
public Integer getGroupIdCount(@Param("groupId")String groupId);
|
||||||
|
|
||||||
|
// 校验分组是否被引用
|
||||||
|
public Integer getCfgInfoByGroupIds(@Param("ids")String ids);
|
||||||
|
}
|
||||||
384
src/main/java/com/nis/web/dao/basics/DomainCommGroupDao.xml
Normal file
384
src/main/java/com/nis/web/dao/basics/DomainCommGroupDao.xml
Normal file
@@ -0,0 +1,384 @@
|
|||||||
|
<?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.DomainCommGroupDao">
|
||||||
|
<resultMap id="domainCommGroupCfgMap" type="com.nis.domain.basics.DomainCommCfg">
|
||||||
|
<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="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" />
|
||||||
|
|
||||||
|
<result column="group_name" property="groupName" jdbcType="VARCHAR" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="columns">
|
||||||
|
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.region_id, r.group_id,r.user_region1,r.user_region2,
|
||||||
|
r.user_region3,r.user_region4,r.user_region5
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="findAllPageList" parameterType="com.nis.domain.basics.DomainCommCfg" resultMap="domainCommGroupCfgMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="columns"></include>
|
||||||
|
<trim prefix="," prefixOverrides=",">
|
||||||
|
,s.name AS creator_name,e.name AS editor_name,u.name AS auditor_name,c.group_name
|
||||||
|
</trim>
|
||||||
|
FROM
|
||||||
|
domain_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
|
||||||
|
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>
|
||||||
|
<if test="groupId != null">
|
||||||
|
AND r.group_id = #{groupId,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="domainCommGroupCfgMap">
|
||||||
|
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
|
||||||
|
domain_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
|
||||||
|
where r.CFG_ID in (${ids})
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findInfoByCfgId" resultMap="domainCommGroupCfgMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="columns"></include>
|
||||||
|
FROM
|
||||||
|
domain_comm_cfg r
|
||||||
|
where r.CFG_ID =#{cfgId}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 修改时检索 -->
|
||||||
|
<select id="get" resultMap="domainCommGroupCfgMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="columns"></include>
|
||||||
|
FROM
|
||||||
|
domain_comm_cfg r
|
||||||
|
WHERE
|
||||||
|
r.cfg_id = #{ids} AND r.is_valid != -1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getCfgInfoByGroupIds" resultType="java.lang.Integer">
|
||||||
|
SELECT
|
||||||
|
COUNT(1)
|
||||||
|
FROM
|
||||||
|
domain_comm_cfg r
|
||||||
|
WHERE
|
||||||
|
r.group_id IN(${ids}) AND r.is_valid != -1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertCommGroupCfg" parameterType="com.nis.domain.basics.DomainCommCfg">
|
||||||
|
insert into domain_comm_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,
|
||||||
|
region_id,
|
||||||
|
group_id,
|
||||||
|
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},
|
||||||
|
#{regionId,jdbcType=INTEGER},
|
||||||
|
#{groupId,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.DomainCommCfg" >
|
||||||
|
update domain_comm_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="groupId != null">
|
||||||
|
group_id = #{groupId,jdbcType=INTEGER}
|
||||||
|
</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 domain_comm_cfg where cfg_id in (${ids})
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="getByIds" resultMap="domainCommGroupCfgMap">
|
||||||
|
select
|
||||||
|
<include refid="columns"></include>
|
||||||
|
from domain_comm_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 domain_comm_cfg
|
||||||
|
WHERE user_region3= #{groupId}
|
||||||
|
and is_valid=1
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -27,5 +27,5 @@ public interface IpCommGroupCfgDao extends CrudDao<IpCommCfg>{
|
|||||||
public int getGroupIdCount(int groupId);
|
public int getGroupIdCount(int groupId);
|
||||||
|
|
||||||
// 校验分组是否被引用
|
// 校验分组是否被引用
|
||||||
public List<IpCommCfg> getCfgInfoByGroupIds(@Param("ids")String ids);
|
public Integer getCfgInfoByGroupIds(@Param("ids")String ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -204,9 +204,9 @@
|
|||||||
r.cfg_id = #{ids} AND r.is_valid != -1
|
r.cfg_id = #{ids} AND r.is_valid != -1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getCfgInfoByGroupIds" resultMap="IpCommGroupCfgMap">
|
<select id="getCfgInfoByGroupIds" resultType="java.lang.Integer">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="columns"></include>
|
COUNT(1)
|
||||||
FROM
|
FROM
|
||||||
ip_comm_cfg r
|
ip_comm_cfg r
|
||||||
WHERE
|
WHERE
|
||||||
@@ -420,9 +420,6 @@
|
|||||||
<if test="auditTime != null and auditTime != ''" >
|
<if test="auditTime != null and auditTime != ''" >
|
||||||
AUDIT_TIME = #{auditTime,jdbcType=TIMESTAMP},
|
AUDIT_TIME = #{auditTime,jdbcType=TIMESTAMP},
|
||||||
</if>
|
</if>
|
||||||
<if test="regionId != null" >
|
|
||||||
REGION_ID = #{regionId,jdbcType=TIMESTAMP},
|
|
||||||
</if>
|
|
||||||
<if test="requestId != null" >
|
<if test="requestId != null" >
|
||||||
REQUEST_ID = #{requestId,jdbcType=INTEGER},
|
REQUEST_ID = #{requestId,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
@@ -647,13 +644,5 @@
|
|||||||
<!-- 数据范围过滤 -->
|
<!-- 数据范围过滤 -->
|
||||||
${sqlMap.dsf}
|
${sqlMap.dsf}
|
||||||
</trim>
|
</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>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.nis.web.dao.basics;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import com.nis.domain.basics.ScriberIdCommCfg;
|
||||||
|
import com.nis.web.dao.CrudDao;
|
||||||
|
import com.nis.web.dao.MyBatisDao;
|
||||||
|
|
||||||
|
@MyBatisDao
|
||||||
|
public interface ScriberIdCommGroupDao extends CrudDao<ScriberIdCommCfg>{
|
||||||
|
|
||||||
|
// 查询列表
|
||||||
|
public List<ScriberIdCommCfg> findAllPageList(ScriberIdCommCfg entity);
|
||||||
|
public List<ScriberIdCommCfg> findByPage(@Param("ids")String ids);
|
||||||
|
|
||||||
|
public List<ScriberIdCommCfg> findInfoByCfgId(@Param("cfgId")Long cfgId);
|
||||||
|
|
||||||
|
//新增
|
||||||
|
public int insertCommGroupCfg(ScriberIdCommCfg entity);
|
||||||
|
|
||||||
|
//修改
|
||||||
|
public int update(ScriberIdCommCfg entity);
|
||||||
|
|
||||||
|
//删除
|
||||||
|
public int delete(@Param("ids")String ids);
|
||||||
|
|
||||||
|
public List<ScriberIdCommCfg> getByIds(@Param("ids")String ids);
|
||||||
|
|
||||||
|
|
||||||
|
public Integer getGroupIdCount(@Param("groupId")String groupId);
|
||||||
|
|
||||||
|
// 校验分组是否被引用
|
||||||
|
public Integer getCfgInfoByGroupIds(@Param("ids")String ids);
|
||||||
|
}
|
||||||
384
src/main/java/com/nis/web/dao/basics/ScriberIdCommGroupDao.xml
Normal file
384
src/main/java/com/nis/web/dao/basics/ScriberIdCommGroupDao.xml
Normal file
@@ -0,0 +1,384 @@
|
|||||||
|
<?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.ScriberIdCommGroupDao">
|
||||||
|
<resultMap id="commGroupCfgMap" type="com.nis.domain.basics.ScriberIdCommCfg">
|
||||||
|
<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="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" />
|
||||||
|
|
||||||
|
<result column="group_name" property="groupName" jdbcType="VARCHAR" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="columns">
|
||||||
|
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.region_id, r.group_id,r.user_region1,r.user_region2,
|
||||||
|
r.user_region3,r.user_region4,r.user_region5
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="findAllPageList" parameterType="com.nis.domain.basics.ScriberIdCommCfg" resultMap="commGroupCfgMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="columns"></include>
|
||||||
|
<trim prefix="," prefixOverrides=",">
|
||||||
|
,s.name AS creator_name,e.name AS editor_name,u.name AS auditor_name,c.group_name
|
||||||
|
</trim>
|
||||||
|
FROM
|
||||||
|
scriberid_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
|
||||||
|
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>
|
||||||
|
<if test="groupId != null">
|
||||||
|
AND r.group_id = #{groupId,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="commGroupCfgMap">
|
||||||
|
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
|
||||||
|
scriberid_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
|
||||||
|
where r.CFG_ID in (${ids})
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="findInfoByCfgId" resultMap="commGroupCfgMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="columns"></include>
|
||||||
|
FROM
|
||||||
|
scriberid_comm_cfg r
|
||||||
|
where r.CFG_ID =#{cfgId}
|
||||||
|
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 修改时检索 -->
|
||||||
|
<select id="get" resultMap="commGroupCfgMap">
|
||||||
|
SELECT
|
||||||
|
<include refid="columns"></include>
|
||||||
|
FROM
|
||||||
|
scriberid_comm_cfg r
|
||||||
|
WHERE
|
||||||
|
r.cfg_id = #{ids} AND r.is_valid != -1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="getCfgInfoByGroupIds" resultType="java.lang.Integer">
|
||||||
|
SELECT
|
||||||
|
COUNT(1)
|
||||||
|
FROM
|
||||||
|
scriberid_comm_cfg r
|
||||||
|
WHERE
|
||||||
|
r.group_id IN(${ids}) AND r.is_valid != -1
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertCommGroupCfg" parameterType="com.nis.domain.basics.ScriberIdCommCfg">
|
||||||
|
insert into scriberid_comm_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,
|
||||||
|
region_id,
|
||||||
|
group_id,
|
||||||
|
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},
|
||||||
|
#{regionId,jdbcType=INTEGER},
|
||||||
|
#{groupId,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.ScriberIdCommCfg" >
|
||||||
|
update scriberid_comm_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="groupId != null">
|
||||||
|
group_id = #{groupId,jdbcType=INTEGER}
|
||||||
|
</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 scriberid_comm_cfg where cfg_id in (${ids})
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<select id="getByIds" resultMap="commGroupCfgMap">
|
||||||
|
select
|
||||||
|
<include refid="columns"></include>
|
||||||
|
from scriberid_comm_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 scriberid_comm_cfg
|
||||||
|
WHERE user_region3= #{groupId}
|
||||||
|
and is_valid=1
|
||||||
|
</select>
|
||||||
|
</mapper>
|
||||||
@@ -36,5 +36,5 @@ public interface UrlCommGroupDao extends CrudDao<UrlCommCfg>{
|
|||||||
public Integer getGroupIdCount(@Param("groupId")String groupId);
|
public Integer getGroupIdCount(@Param("groupId")String groupId);
|
||||||
|
|
||||||
// 校验分组是否被引用
|
// 校验分组是否被引用
|
||||||
public List<UrlCommCfg> getCfgInfoByGroupIds(@Param("ids")String ids);
|
public Integer getCfgInfoByGroupIds(@Param("ids")String ids);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,9 +186,9 @@
|
|||||||
r.cfg_id = #{ids} AND r.is_valid != -1
|
r.cfg_id = #{ids} AND r.is_valid != -1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getCfgInfoByGroupIds" resultMap="urlCommGroupCfgMap">
|
<select id="getCfgInfoByGroupIds" resultType="java.lang.Integer">
|
||||||
SELECT
|
SELECT
|
||||||
<include refid="columns"></include>
|
COUNT(1)
|
||||||
FROM
|
FROM
|
||||||
url_comm_cfg r
|
url_comm_cfg r
|
||||||
WHERE
|
WHERE
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
package com.nis.web.service.basics;
|
package com.nis.web.service.basics;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -7,20 +11,27 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.nis.domain.basics.PolicyGroupInfo;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.basics.CommonGroupInfo;
|
import com.nis.domain.basics.CommonGroupInfo;
|
||||||
|
import com.nis.domain.basics.DomainCommCfg;
|
||||||
import com.nis.domain.basics.IpCommCfg;
|
import com.nis.domain.basics.IpCommCfg;
|
||||||
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
|
import com.nis.domain.basics.ProtectionListInfo;
|
||||||
|
import com.nis.domain.basics.ScriberIdCommCfg;
|
||||||
import com.nis.domain.basics.UrlCommCfg;
|
import com.nis.domain.basics.UrlCommCfg;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.CacheUtils;
|
||||||
import com.nis.util.ConfigServiceUtil;
|
import com.nis.util.ConfigServiceUtil;
|
||||||
|
import com.nis.util.Constants;
|
||||||
import com.nis.util.StringUtil;
|
import com.nis.util.StringUtil;
|
||||||
import com.nis.web.dao.basics.CommonGroupManageDao;
|
import com.nis.web.dao.basics.CommonGroupManageDao;
|
||||||
|
import com.nis.web.dao.basics.DomainCommGroupDao;
|
||||||
import com.nis.web.dao.basics.IpCommGroupCfgDao;
|
import com.nis.web.dao.basics.IpCommGroupCfgDao;
|
||||||
|
import com.nis.web.dao.basics.ScriberIdCommGroupDao;
|
||||||
import com.nis.web.dao.basics.UrlCommGroupDao;
|
import com.nis.web.dao.basics.UrlCommGroupDao;
|
||||||
import com.nis.web.security.UserUtils;
|
import com.nis.web.security.UserUtils;
|
||||||
import com.nis.web.service.BaseService;
|
import com.nis.web.service.BaseService;
|
||||||
@@ -33,9 +44,12 @@ public class CommonGroupManageService extends BaseService{
|
|||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IpCommGroupCfgDao ipCommGroupCfgDao; // 校验分组时使用
|
private IpCommGroupCfgDao ipCommGroupCfgDao; // 校验分组时使用
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private UrlCommGroupDao urlCommGroupDao;
|
private UrlCommGroupDao urlCommGroupDao;
|
||||||
|
@Autowired
|
||||||
|
private DomainCommGroupDao domainCommGroupDao;
|
||||||
|
@Autowired
|
||||||
|
private ScriberIdCommGroupDao scriberIdCommGroupDao;
|
||||||
|
|
||||||
public Page<CommonGroupInfo> findCommonGroupInfoList(Page<CommonGroupInfo> page, CommonGroupInfo entity) {
|
public Page<CommonGroupInfo> findCommonGroupInfoList(Page<CommonGroupInfo> page, CommonGroupInfo entity) {
|
||||||
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
|
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
|
||||||
@@ -68,7 +82,7 @@ public class CommonGroupManageService extends BaseService{
|
|||||||
}
|
}
|
||||||
entity.setServiceGroupId(serviceGroupId);
|
entity.setServiceGroupId(serviceGroupId);
|
||||||
commonGroupManageDao.insert(entity);
|
commonGroupManageDao.insert(entity);
|
||||||
|
this.updatePolicyGroupDict(entity.getGroupType()+"");
|
||||||
}else{ // 修改
|
}else{ // 修改
|
||||||
Date editTime=new Date();
|
Date editTime=new Date();
|
||||||
entity.setEditorId(UserUtils.getUser().getId());
|
entity.setEditorId(UserUtils.getUser().getId());
|
||||||
@@ -80,7 +94,7 @@ public class CommonGroupManageService extends BaseService{
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void deldete(String ids, int isValid){
|
public void deldete(String ids, int isValid, String groupTypes){
|
||||||
CommonGroupInfo entity=new CommonGroupInfo();
|
CommonGroupInfo entity=new CommonGroupInfo();
|
||||||
Date editTime=new Date();
|
Date editTime=new Date();
|
||||||
entity.setEditorId(UserUtils.getUser().getId());
|
entity.setEditorId(UserUtils.getUser().getId());
|
||||||
@@ -121,28 +135,71 @@ public class CommonGroupManageService extends BaseService{
|
|||||||
for(PolicyGroupInfo info:policyGroupInfos){
|
for(PolicyGroupInfo info:policyGroupInfos){
|
||||||
boolean update=false;
|
boolean update=false;
|
||||||
Integer udFlag = 0;
|
Integer udFlag = 0;
|
||||||
|
Integer size = 0;
|
||||||
if(groupType == 5) { // IP
|
if(groupType == 5) { // IP
|
||||||
List<IpCommCfg> list = ipCommGroupCfgDao.getCfgInfoByGroupIds(info.getServiceGroupId().toString());
|
size = ipCommGroupCfgDao.getCfgInfoByGroupIds(info.getServiceGroupId().toString());
|
||||||
if(list.size() > 0&&info.getUdFlag().equals(0)) {
|
|
||||||
update=true;
|
|
||||||
udFlag = 1; // 可用
|
|
||||||
}else if(list.size()==0&&info.getUdFlag().equals(2)){
|
|
||||||
update=true;
|
|
||||||
}
|
|
||||||
}else if(groupType == 7) { // URL
|
}else if(groupType == 7) { // URL
|
||||||
List<UrlCommCfg> list = urlCommGroupDao.getCfgInfoByGroupIds(info.getServiceGroupId().toString());
|
size = urlCommGroupDao.getCfgInfoByGroupIds(info.getServiceGroupId().toString());
|
||||||
if(list.size() > 0&&info.getUdFlag().equals(0)) {
|
}else if(groupType == 8) { // Domain
|
||||||
|
size = domainCommGroupDao.getCfgInfoByGroupIds(info.getServiceGroupId().toString());
|
||||||
|
}else if(groupType == 9) { // ScriberId
|
||||||
|
size = scriberIdCommGroupDao.getCfgInfoByGroupIds(info.getServiceGroupId().toString());
|
||||||
|
}
|
||||||
|
|
||||||
|
if(size > 0 && info.getUdFlag().equals(0)) {
|
||||||
update=true;
|
update=true;
|
||||||
udFlag = 1;
|
udFlag = 1;
|
||||||
}else if(list.size()==0&&info.getUdFlag().equals(2)){
|
}else if(size == 0 && !info.getUdFlag().equals(2)){
|
||||||
update=true;
|
update=true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if(update){
|
if(update){
|
||||||
commonGroupManageDao.updateGroupStatus(info.getServiceGroupId().toString(), udFlag, groupType);
|
commonGroupManageDao.updateGroupStatus(info.getServiceGroupId().toString(), udFlag, groupType);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public CommonGroupInfo getGroupInfo(CommonGroupInfo searchCfg) {
|
||||||
|
return commonGroupManageDao.getGroupInfo(searchCfg);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新字典缓存
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private void updatePolicyGroupDict(String groupTypes) {
|
||||||
|
String dictKey = Constants.CACHE_IPGROUP_DICT;
|
||||||
|
if(groupTypes.contains(",")) {
|
||||||
|
String[] split = groupTypes.split(",");
|
||||||
|
List<String> asList = Arrays.asList(split);
|
||||||
|
HashSet<String> strings = new HashSet<>(asList);
|
||||||
|
for (String str : strings) {
|
||||||
|
Integer groupType = Integer.valueOf(str);
|
||||||
|
if(groupType.equals(7)) {
|
||||||
|
dictKey = Constants.CACHE_URLGROUP_DICT;
|
||||||
|
}else if(groupType.equals(8)) {
|
||||||
|
dictKey = Constants.CACHE_DOMAINGROUP_DICT;
|
||||||
|
}else if(groupType.equals(9)) {
|
||||||
|
dictKey = Constants.CACHE_SCRIBERGROUP_DICT;
|
||||||
|
}
|
||||||
|
List<CommonGroupInfo> groupInfo = findCommonGroupInfosByType(groupType);
|
||||||
|
CacheUtils.put(dictKey, groupInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
Integer groupType = Integer.valueOf(groupTypes);
|
||||||
|
if(groupType.equals(7)) {
|
||||||
|
dictKey = Constants.CACHE_URLGROUP_DICT;
|
||||||
|
}else if(groupType.equals(8)) {
|
||||||
|
dictKey = Constants.CACHE_DOMAINGROUP_DICT;
|
||||||
|
}else if(groupType.equals(9)) {
|
||||||
|
dictKey = Constants.CACHE_SCRIBERGROUP_DICT;
|
||||||
|
}
|
||||||
|
List<CommonGroupInfo> groupInfo = findCommonGroupInfosByType(groupType);
|
||||||
|
CacheUtils.put(dictKey, groupInfo);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,180 @@
|
|||||||
|
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.FunctionRegionDict;
|
||||||
|
import com.nis.domain.FunctionServiceDict;
|
||||||
|
import com.nis.domain.Page;
|
||||||
|
import com.nis.domain.basics.DomainCommCfg;
|
||||||
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.ConfigServiceUtil;
|
||||||
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.web.dao.CrudDao;
|
||||||
|
import com.nis.web.dao.basics.DomainCommGroupDao;
|
||||||
|
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||||
|
import com.nis.web.service.CrudService;
|
||||||
|
import com.nis.web.service.SpringContextHolder;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class DomainCommGroupService extends CrudService<CrudDao<DomainCommCfg>, DomainCommCfg>{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DomainCommGroupDao domainCommGroupDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PolicyGroupInfoDao policyGroupInfoDao;
|
||||||
|
|
||||||
|
private CommonGroupManageService groupManageService = SpringContextHolder.getBean(CommonGroupManageService.class);
|
||||||
|
|
||||||
|
public Page<DomainCommCfg> findPage(Page<DomainCommCfg> page, DomainCommCfg entity) {
|
||||||
|
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
|
||||||
|
entity.setPage(page);
|
||||||
|
List<DomainCommCfg> list=domainCommGroupDao.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<DomainCommCfg> findByPage(String ids) {
|
||||||
|
List<DomainCommCfg> list=domainCommGroupDao.findByPage(ids);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DomainCommCfg get(Long id ) {
|
||||||
|
return domainCommGroupDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void saveCommGroupCfg(CfgIndexInfo entity) {
|
||||||
|
Date createTime=new Date();
|
||||||
|
if(entity.getDomainCommGroupList()!=null) {
|
||||||
|
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString());
|
||||||
|
for (int i = 0; i < entity.getDomainCommGroupList().size(); i++) {
|
||||||
|
BeanUtils.copyProperties(entity, entity.getDomainCommGroupList().get(i), new String[]{"cfgId"});
|
||||||
|
Integer regionId = 0;
|
||||||
|
List<Integer> regionIds = ConfigServiceUtil.getId(3, 1);
|
||||||
|
if(regionIds!=null && regionIds.size()>0){
|
||||||
|
regionId = regionIds.get(0);
|
||||||
|
}else {
|
||||||
|
throw new MaatConvertException("Get region id failed");
|
||||||
|
}
|
||||||
|
entity.getDomainCommGroupList().get(i).setRegionId(regionId);
|
||||||
|
entity.getDomainCommGroupList().get(i).setRequestId(0);
|
||||||
|
entity.getDomainCommGroupList().get(i).setClassify("0");
|
||||||
|
entity.getDomainCommGroupList().get(i).setAttribute("0");
|
||||||
|
entity.getDomainCommGroupList().get(i).setLable("0");
|
||||||
|
entity.getDomainCommGroupList().get(i).setIsHexbin(2);
|
||||||
|
entity.getDomainCommGroupList().get(i).setCreateTime(createTime);
|
||||||
|
entity.getDomainCommGroupList().get(i).setCreatorId(entity.getCurrentUser().getId());
|
||||||
|
entity.getDomainCommGroupList().get(i).setIsValid(Constants.VALID_NO);
|
||||||
|
entity.getDomainCommGroupList().get(i).setIsAudit(Constants.AUDIT_NOT_YET);
|
||||||
|
if(entity.getDomainCommGroupList().get(i).getCfgKeywords().contains("***and***")){
|
||||||
|
entity.getDomainCommGroupList().get(i).setExprType(1);
|
||||||
|
}else{
|
||||||
|
entity.getDomainCommGroupList().get(i).setExprType(0);
|
||||||
|
}
|
||||||
|
entity.getDomainCommGroupList().get(i).setGroupId(entity.getGroupId());
|
||||||
|
|
||||||
|
domainCommGroupDao.insertCommGroupCfg(entity.getDomainCommGroupList().get(i));
|
||||||
|
}
|
||||||
|
// 更新分组状态
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, 8);
|
||||||
|
//TODO 组配置更新时 需检索是否被其它配置引用,若被引用需调用相应服务接口更新配置
|
||||||
|
//transObjGroupToMaat(policyGroupInfos);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void update(DomainCommCfg 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);
|
||||||
|
}
|
||||||
|
domainCommGroupDao.update(entity);
|
||||||
|
|
||||||
|
// 更新分组状态
|
||||||
|
if(!entity.getUserRegion1().equals(entity.getGroupId().toString())) {
|
||||||
|
List<PolicyGroupInfo> policyGroupInfos = new ArrayList<PolicyGroupInfo>();
|
||||||
|
policyGroupInfos.addAll(policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getUserRegion1()));
|
||||||
|
policyGroupInfos.addAll(policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString()));
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, 8);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void delete(String ids, String groupIds) {
|
||||||
|
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
||||||
|
domainCommGroupDao.delete(ids);
|
||||||
|
// 更新分组状态
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, 8);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<DomainCommCfg> getByIds(String ids) {
|
||||||
|
if(ids==null) {
|
||||||
|
throw new RuntimeException("ids is null!");
|
||||||
|
}
|
||||||
|
return domainCommGroupDao.getByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void saveAndSend(FunctionRegionDict regionDict, FunctionServiceDict serviceDict, List<BaseStringCfg<?>> cfgs) {
|
||||||
|
logger.warn("Start to save Domain,size:"+cfgs.size());
|
||||||
|
long start=System.currentTimeMillis();
|
||||||
|
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||||
|
SqlSession batchSqlSession = null;
|
||||||
|
// 需要通过新增域接口新增的ip集合
|
||||||
|
try{
|
||||||
|
String ids = "";
|
||||||
|
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||||
|
for(BaseStringCfg<?> cfg:cfgs) {
|
||||||
|
if(!ids.contains(cfg.getGroupId()+"")) {
|
||||||
|
ids += ","+cfg.getGroupId();
|
||||||
|
}
|
||||||
|
DomainCommCfg DomainCommCfg=new DomainCommCfg();
|
||||||
|
BeanUtils.copyProperties(cfg, DomainCommCfg);
|
||||||
|
((DomainCommGroupDao) batchSqlSession.getMapper(DomainCommGroupDao.class)).insertCommGroupCfg(DomainCommCfg);
|
||||||
|
}
|
||||||
|
batchSqlSession.commit();
|
||||||
|
|
||||||
|
// 更新分组状态
|
||||||
|
String serviceGroupIds = ids.substring(1);
|
||||||
|
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoDao.findPolicyByServiceGroupInfoList(serviceGroupIds);
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, 8);
|
||||||
|
|
||||||
|
}finally {
|
||||||
|
if(batchSqlSession != null){
|
||||||
|
batchSqlSession.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
long end=System.currentTimeMillis();
|
||||||
|
logger.warn("Save Domain finish,cost:"+(end-start));
|
||||||
|
cfgs.clear();
|
||||||
|
cfgs=null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -73,12 +73,14 @@ public class IpCommGroupCfgService extends BaseService {
|
|||||||
}
|
}
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void update(IpCommCfg entity){
|
public void update(IpCommCfg entity){
|
||||||
List<PolicyGroupInfo> policyGroupInfosOld=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getUserRegion1());
|
|
||||||
List<PolicyGroupInfo> policyGroupInfosNew=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString());
|
|
||||||
ipCommGroupCfgDao.update(entity);
|
ipCommGroupCfgDao.update(entity);
|
||||||
// 更新分组状态
|
// 更新分组状态
|
||||||
groupManageService.updateGroupStatus(policyGroupInfosOld, 5); // old
|
if(!entity.getUserRegion1().equals(entity.getGroupId().toString())) {
|
||||||
groupManageService.updateGroupStatus(policyGroupInfosNew, 5); // new
|
List<PolicyGroupInfo> policyGroupInfos = new ArrayList<PolicyGroupInfo>();
|
||||||
|
policyGroupInfos.addAll(policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getUserRegion1()));
|
||||||
|
policyGroupInfos.addAll(policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString()));
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, 5);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,45 +140,36 @@ public class IpCommGroupCfgService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void saveAndSend(FunctionRegionDict regionDict, FunctionServiceDict serviceDict, List<BaseIpCfg> cfgs,boolean send) {
|
public void saveAndSend(FunctionRegionDict regionDict, FunctionServiceDict serviceDict, List<BaseIpCfg> cfgs) {
|
||||||
logger.warn("Start to save IP,size:"+cfgs.size());
|
logger.warn("Start to save IP,size:"+cfgs.size());
|
||||||
long start=System.currentTimeMillis();
|
long start=System.currentTimeMillis();
|
||||||
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||||
SqlSession batchSqlSession = null;
|
SqlSession batchSqlSession = null;
|
||||||
//需要通过新增域接口新增的ip集合
|
//需要通过新增域接口新增的ip集合
|
||||||
Map<Integer,Integer> groupCount=Maps.newHashMap();
|
|
||||||
List<IpCommCfg> ipCommCfgs=new ArrayList(cfgs.size());
|
|
||||||
try{
|
try{
|
||||||
|
String ids = "";
|
||||||
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||||
|
|
||||||
for(BaseIpCfg cfg:cfgs) {
|
for(BaseIpCfg cfg:cfgs) {
|
||||||
|
if(!ids.contains(cfg.getGroupId()+"")) {
|
||||||
|
ids += ","+cfg.getGroupId();
|
||||||
|
}
|
||||||
IpCommCfg ipCommCfg=new IpCommCfg();
|
IpCommCfg ipCommCfg=new IpCommCfg();
|
||||||
BeanUtils.copyProperties(cfg, ipCommCfg);
|
BeanUtils.copyProperties(cfg, ipCommCfg);
|
||||||
ipCommCfgs.add(ipCommCfg);
|
|
||||||
((IpCommGroupCfgDao) batchSqlSession.getMapper(IpCommGroupCfgDao.class)).insertForBatch(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();
|
batchSqlSession.commit();
|
||||||
|
|
||||||
|
// 更新分组状态
|
||||||
|
String serviceGroupIds = ids.substring(1);
|
||||||
|
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoDao.findPolicyByServiceGroupInfoList(serviceGroupIds);
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, 5);
|
||||||
|
|
||||||
}finally {
|
}finally {
|
||||||
if(batchSqlSession != null){
|
if(batchSqlSession != null){
|
||||||
batchSqlSession.close();
|
batchSqlSession.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
long end=System.currentTimeMillis();
|
long end=System.currentTimeMillis();
|
||||||
logger.warn("Save IP finish,cost:"+(end-start));
|
logger.warn("Save IP finish,cost:"+(end-start));
|
||||||
|
|||||||
@@ -0,0 +1,182 @@
|
|||||||
|
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.FunctionRegionDict;
|
||||||
|
import com.nis.domain.FunctionServiceDict;
|
||||||
|
import com.nis.domain.Page;
|
||||||
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
|
import com.nis.domain.basics.ScriberIdCommCfg;
|
||||||
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
|
import com.nis.exceptions.MaatConvertException;
|
||||||
|
import com.nis.util.ConfigServiceUtil;
|
||||||
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.web.dao.CrudDao;
|
||||||
|
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||||
|
import com.nis.web.dao.basics.ScriberIdCommGroupDao;
|
||||||
|
import com.nis.web.service.CrudService;
|
||||||
|
import com.nis.web.service.SpringContextHolder;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ScriberIdCommGroupService extends CrudService<CrudDao<ScriberIdCommCfg>, ScriberIdCommCfg>{
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ScriberIdCommGroupDao scriberIdCommGroupDao;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PolicyGroupInfoDao policyGroupInfoDao;
|
||||||
|
|
||||||
|
private CommonGroupManageService groupManageService = SpringContextHolder.getBean(CommonGroupManageService.class);
|
||||||
|
|
||||||
|
public Page<ScriberIdCommCfg> findPage(Page<ScriberIdCommCfg> page, ScriberIdCommCfg entity) {
|
||||||
|
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
|
||||||
|
entity.setPage(page);
|
||||||
|
List<ScriberIdCommCfg> list=scriberIdCommGroupDao.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<ScriberIdCommCfg> findByPage(String ids) {
|
||||||
|
List<ScriberIdCommCfg> list=scriberIdCommGroupDao.findByPage(ids);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ScriberIdCommCfg get(Long id ) {
|
||||||
|
return scriberIdCommGroupDao.get(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void saveCommGroupCfg(CfgIndexInfo entity) {
|
||||||
|
Date createTime=new Date();
|
||||||
|
if(entity.getScriberIdCommGroupList()!=null) {
|
||||||
|
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString());
|
||||||
|
for (int i = 0; i < entity.getScriberIdCommGroupList().size(); i++) {
|
||||||
|
BeanUtils.copyProperties(entity, entity.getScriberIdCommGroupList().get(i), new String[]{"cfgId"});
|
||||||
|
Integer regionId = 0;
|
||||||
|
List<Integer> regionIds = ConfigServiceUtil.getId(3, 1);
|
||||||
|
if(regionIds!=null && regionIds.size()>0){
|
||||||
|
regionId = regionIds.get(0);
|
||||||
|
}else {
|
||||||
|
throw new MaatConvertException("Get region id failed");
|
||||||
|
}
|
||||||
|
entity.getScriberIdCommGroupList().get(i).setRegionId(regionId);
|
||||||
|
entity.getScriberIdCommGroupList().get(i).setRequestId(0);
|
||||||
|
entity.getScriberIdCommGroupList().get(i).setClassify("0");
|
||||||
|
entity.getScriberIdCommGroupList().get(i).setAttribute("0");
|
||||||
|
entity.getScriberIdCommGroupList().get(i).setLable("0");
|
||||||
|
entity.getScriberIdCommGroupList().get(i).setIsHexbin(2);
|
||||||
|
entity.getScriberIdCommGroupList().get(i).setCreateTime(createTime);
|
||||||
|
entity.getScriberIdCommGroupList().get(i).setCreatorId(entity.getCurrentUser().getId());
|
||||||
|
entity.getScriberIdCommGroupList().get(i).setIsValid(Constants.VALID_NO);
|
||||||
|
entity.getScriberIdCommGroupList().get(i).setIsAudit(Constants.AUDIT_NOT_YET);
|
||||||
|
if(entity.getScriberIdCommGroupList().get(i).getCfgKeywords().contains("***and***")){
|
||||||
|
entity.getScriberIdCommGroupList().get(i).setExprType(1);
|
||||||
|
}else{
|
||||||
|
entity.getScriberIdCommGroupList().get(i).setExprType(0);
|
||||||
|
}
|
||||||
|
entity.getScriberIdCommGroupList().get(i).setGroupId(entity.getGroupId());
|
||||||
|
|
||||||
|
scriberIdCommGroupDao.insertCommGroupCfg(entity.getScriberIdCommGroupList().get(i));
|
||||||
|
}
|
||||||
|
// 更新分组状态
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, 9);
|
||||||
|
//TODO 组配置更新时 需检索是否被其它配置引用,若被引用需调用相应服务接口更新配置
|
||||||
|
//transObjGroupToMaat(policyGroupInfos);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void update(ScriberIdCommCfg 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);
|
||||||
|
}
|
||||||
|
scriberIdCommGroupDao.update(entity);
|
||||||
|
|
||||||
|
// 更新分组状态
|
||||||
|
if(!entity.getUserRegion1().equals(entity.getGroupId().toString())) {
|
||||||
|
List<PolicyGroupInfo> policyGroupInfos = new ArrayList<PolicyGroupInfo>();
|
||||||
|
policyGroupInfos.addAll(policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getUserRegion1()));
|
||||||
|
policyGroupInfos.addAll(policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString()));
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, 9);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void delete(String ids, String groupIds) {
|
||||||
|
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(groupIds);
|
||||||
|
scriberIdCommGroupDao.delete(ids);
|
||||||
|
// 更新分组状态
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, 9);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<ScriberIdCommCfg> getByIds(String ids) {
|
||||||
|
if(ids==null) {
|
||||||
|
throw new RuntimeException("ids is null!");
|
||||||
|
}
|
||||||
|
return scriberIdCommGroupDao.getByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void saveAndSend(FunctionRegionDict regionDict, FunctionServiceDict serviceDict, List<BaseStringCfg<?>> cfgs) {
|
||||||
|
logger.warn("Start to save ScriberId,size:"+cfgs.size());
|
||||||
|
long start=System.currentTimeMillis();
|
||||||
|
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||||
|
SqlSession batchSqlSession = null;
|
||||||
|
// 需要通过新增域接口新增的ip集合
|
||||||
|
try{
|
||||||
|
String ids = "";
|
||||||
|
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||||
|
for(BaseStringCfg<?> cfg:cfgs) {
|
||||||
|
if(!ids.contains(cfg.getGroupId()+"")) {
|
||||||
|
ids += ","+cfg.getGroupId();
|
||||||
|
}
|
||||||
|
ScriberIdCommCfg commCfg=new ScriberIdCommCfg();
|
||||||
|
BeanUtils.copyProperties(cfg, commCfg);
|
||||||
|
((ScriberIdCommGroupDao) batchSqlSession.getMapper(ScriberIdCommGroupDao.class)).insertCommGroupCfg(commCfg);
|
||||||
|
}
|
||||||
|
batchSqlSession.commit();
|
||||||
|
|
||||||
|
// 更新分组状态
|
||||||
|
String serviceGroupIds = ids.substring(1);
|
||||||
|
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoDao.findPolicyByServiceGroupInfoList(serviceGroupIds);
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, 9);
|
||||||
|
|
||||||
|
}finally {
|
||||||
|
if(batchSqlSession != null){
|
||||||
|
batchSqlSession.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
long end=System.currentTimeMillis();
|
||||||
|
logger.warn("Save ScriberId finish,cost:"+(end-start));
|
||||||
|
cfgs.clear();
|
||||||
|
cfgs=null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,17 +1,25 @@
|
|||||||
package com.nis.web.service.basics;
|
package com.nis.web.service.basics;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.nis.domain.basics.PolicyGroupInfo;
|
import com.nis.domain.basics.PolicyGroupInfo;
|
||||||
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
import com.nis.web.dao.basics.PolicyGroupInfoDao;
|
||||||
|
|
||||||
|
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.BeanUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import com.nis.domain.FunctionRegionDict;
|
||||||
|
import com.nis.domain.FunctionServiceDict;
|
||||||
import com.nis.domain.Page;
|
import com.nis.domain.Page;
|
||||||
import com.nis.domain.basics.UrlCommCfg;
|
import com.nis.domain.basics.UrlCommCfg;
|
||||||
|
import com.nis.domain.configuration.BaseStringCfg;
|
||||||
import com.nis.domain.configuration.CfgIndexInfo;
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
import com.nis.exceptions.MaatConvertException;
|
import com.nis.exceptions.MaatConvertException;
|
||||||
import com.nis.util.ConfigServiceUtil;
|
import com.nis.util.ConfigServiceUtil;
|
||||||
@@ -55,8 +63,8 @@ public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCom
|
|||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void saveUrlCommGroupCfg(CfgIndexInfo entity) {
|
public void saveUrlCommGroupCfg(CfgIndexInfo entity) {
|
||||||
Date createTime=new Date();
|
Date createTime=new Date();
|
||||||
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString());
|
|
||||||
if(entity.getUrlCommGroupList()!=null) {
|
if(entity.getUrlCommGroupList()!=null) {
|
||||||
|
List<PolicyGroupInfo> policyGroupInfos=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString());
|
||||||
for (int i = 0; i < entity.getUrlCommGroupList().size(); i++) {
|
for (int i = 0; i < entity.getUrlCommGroupList().size(); i++) {
|
||||||
BeanUtils.copyProperties(entity, entity.getUrlCommGroupList().get(i), new String[]{"cfgId"});
|
BeanUtils.copyProperties(entity, entity.getUrlCommGroupList().get(i), new String[]{"cfgId"});
|
||||||
Integer regionId = 0;
|
Integer regionId = 0;
|
||||||
@@ -104,11 +112,14 @@ public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCom
|
|||||||
entity.setExprType(0);
|
entity.setExprType(0);
|
||||||
}
|
}
|
||||||
urlCommGroupDao.update(entity);
|
urlCommGroupDao.update(entity);
|
||||||
List<PolicyGroupInfo> policyGroupInfosOld=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getUserRegion1());
|
|
||||||
List<PolicyGroupInfo> policyGroupInfosNew=policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString());
|
|
||||||
// 更新分组状态
|
// 更新分组状态
|
||||||
groupManageService.updateGroupStatus(policyGroupInfosOld, 7); // old
|
if(!entity.getUserRegion1().equals(entity.getGroupId().toString())) {
|
||||||
groupManageService.updateGroupStatus(policyGroupInfosNew, 7); // new
|
List<PolicyGroupInfo> policyGroupInfos = new ArrayList<PolicyGroupInfo>();
|
||||||
|
policyGroupInfos.addAll(policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getUserRegion1()));
|
||||||
|
policyGroupInfos.addAll(policyGroupInfoDao.findPolicyByServiceGroupInfoList(entity.getGroupId().toString()));
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, 7);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -127,25 +138,41 @@ public class UrlCommGroupService extends CrudService<CrudDao<UrlCommCfg>, UrlCom
|
|||||||
return urlCommGroupDao.getByIds(ids);
|
return urlCommGroupDao.getByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void audit(UrlCommCfg urlGroupCfg,Integer isAudit,Integer isValid) {
|
public void saveAndSend(FunctionRegionDict regionDict, FunctionServiceDict serviceDict, List<BaseStringCfg<?>> cfgs) {
|
||||||
|
logger.warn("Start to save URL,size:"+cfgs.size());
|
||||||
if(!StringUtil.isEmpty(urlGroupCfg)){
|
long start=System.currentTimeMillis();
|
||||||
urlGroupCfg.setIsValid(isValid);
|
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||||
urlGroupCfg.setIsAudit(isAudit);
|
SqlSession batchSqlSession = null;
|
||||||
urlGroupCfg.setAuditorId(UserUtils.getUser().getId());
|
// 需要通过新增域接口新增的ip集合
|
||||||
urlGroupCfg.setAuditTime(new Date());
|
try{
|
||||||
|
String ids = "";
|
||||||
urlCommGroupDao.update(urlGroupCfg);
|
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||||
|
for(BaseStringCfg<?> cfg:cfgs) {
|
||||||
|
if(!ids.contains(cfg.getGroupId()+"")) {
|
||||||
|
ids += ","+cfg.getGroupId();
|
||||||
}
|
}
|
||||||
//下发配置时改变公共组udFlag标识
|
UrlCommCfg urlCommCfg=new UrlCommCfg();
|
||||||
//查询有效的url配置个数
|
BeanUtils.copyProperties(cfg, urlCommCfg);
|
||||||
Integer groupCount=urlCommGroupDao.getGroupIdCount(urlGroupCfg.getUserRegion3());
|
((UrlCommGroupDao) batchSqlSession.getMapper(UrlCommGroupDao.class)).insertUrlCommGroupCfg(urlCommCfg);
|
||||||
if(groupCount>0){//udFlag 设置为1
|
}
|
||||||
urlCommGroupDao.updateUrlUdFlag(Integer.parseInt(urlGroupCfg.getUserRegion3()), 1);
|
batchSqlSession.commit();
|
||||||
}else{//udFlag 设置为0
|
|
||||||
urlCommGroupDao.updateUrlUdFlag(Integer.parseInt(urlGroupCfg.getUserRegion3()), 0);
|
// 更新分组状态
|
||||||
|
String serviceGroupIds = ids.substring(1);
|
||||||
|
List<PolicyGroupInfo> policyGroupInfos = policyGroupInfoDao.findPolicyByServiceGroupInfoList(serviceGroupIds);
|
||||||
|
groupManageService.updateGroupStatus(policyGroupInfos, 7);
|
||||||
|
|
||||||
|
}finally {
|
||||||
|
if(batchSqlSession != null){
|
||||||
|
batchSqlSession.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
long end=System.currentTimeMillis();
|
||||||
|
logger.warn("Save URL finish,cost:"+(end-start));
|
||||||
|
cfgs.clear();
|
||||||
|
cfgs=null;
|
||||||
}
|
}
|
||||||
}*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1628,3 +1628,10 @@ stream_trace_id=Stream Trace ID
|
|||||||
ssl_error=SSL Error
|
ssl_error=SSL Error
|
||||||
import_built_cert_file=Import built-in certificate
|
import_built_cert_file=Import built-in certificate
|
||||||
built_in=built-in
|
built_in=built-in
|
||||||
|
#---------------------------Object List Group Manage------------------------------------
|
||||||
|
ip_group_configuration=IP Group Configuration
|
||||||
|
domain_group_configuration=Domain Group Configuration
|
||||||
|
scriberid_group_configuration=ScriberId Group Configuration
|
||||||
|
common_group_manage=Common Group Manage
|
||||||
|
can_not_delete_issued_group=Can not delete issued group
|
||||||
|
#---------------------------Object List Group Manage------------------------------------
|
||||||
@@ -1630,3 +1630,10 @@ stream_trace_id=Stream Trace ID
|
|||||||
ssl_error=SSL Error
|
ssl_error=SSL Error
|
||||||
import_built_cert_file=Import built-in certificate
|
import_built_cert_file=Import built-in certificate
|
||||||
built_in=built-in
|
built_in=built-in
|
||||||
|
#---------------------------Object List Group Manage------------------------------------
|
||||||
|
ip_group_configuration=IP Group Configuration
|
||||||
|
domain_group_configuration=Domain Group Configuration
|
||||||
|
scriberid_group_configuration=ScriberId Group Configuration
|
||||||
|
common_group_manage=Common Group Manage
|
||||||
|
can_not_delete_issued_group=Can not delete issued group
|
||||||
|
#---------------------------Object List Group Manage------------------------------------
|
||||||
@@ -1628,3 +1628,10 @@ stream_trace_id=\u6d41\u7684\u8ffd\u8e2aID
|
|||||||
ssl_error=SSL\u9519\u8bef\u4fe1\u606f
|
ssl_error=SSL\u9519\u8bef\u4fe1\u606f
|
||||||
import_built_cert_file=\u5BFC\u5165\u5185\u7F6E\u8BC1\u4E66
|
import_built_cert_file=\u5BFC\u5165\u5185\u7F6E\u8BC1\u4E66
|
||||||
built_in=\u5185\u7F6E\u8BC1\u4E66
|
built_in=\u5185\u7F6E\u8BC1\u4E66
|
||||||
|
#---------------------------Object List Group Manage------------------------------------
|
||||||
|
ip_group_configuration=IP \u5206\u7ec4\u914d\u7f6e
|
||||||
|
domain_group_configuration=\u57DF\u540D\u5206\u7ec4\u914d\u7f6e
|
||||||
|
scriberid_group_configuration=\u8D26\u53F7\u5206\u7ec4\u914d\u7f6e
|
||||||
|
common_group_manage=\u516C\u5171\u5206\u7EC4\u7BA1\u7406
|
||||||
|
can_not_delete_issued_group=\u4E0D\u80FD\u5220\u9664\u5DF2\u7ECF\u88AB\u5F15\u7528\u7684\u5206\u7EC4
|
||||||
|
#---------------------------Object List Group Manage------------------------------------
|
||||||
@@ -85,3 +85,83 @@ CREATE TABLE `url_comm_cfg` (
|
|||||||
KEY `http_url_cfg_compileId` (`compile_id`),
|
KEY `http_url_cfg_compileId` (`compile_id`),
|
||||||
KEY `http_url_cfg_functionId` (`function_id`)
|
KEY `http_url_cfg_functionId` (`function_id`)
|
||||||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
|
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
|
||||||
|
|
||||||
|
CREATE TABLE `domain_comm_cfg` (
|
||||||
|
`cfg_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增',
|
||||||
|
`cfg_desc` varchar(128) DEFAULT NULL,
|
||||||
|
`cfg_keywords` varchar(2048) NOT NULL,
|
||||||
|
`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删除;1) 未审核时配置可删除;2) 审核通过,此字段置1;3) 取消审核通过,此字段置0',
|
||||||
|
`is_audit` int(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3取消审核通过;1) 审核未通过,配置可修改;2) 审核通过,配置不可删除,只能取消审核通过',
|
||||||
|
`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) NOT 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,多个用英文逗号分隔',
|
||||||
|
`expr_type` int(11) NOT NULL COMMENT '0:无表达式,1:与表达式',
|
||||||
|
`match_method` int(11) NOT NULL COMMENT 'expr_type:0时有意义,其它情况必须置0。0:子串匹配;1:右匹配;2:左匹配;3:完全匹配',
|
||||||
|
`is_hexbin` int(11) NOT NULL COMMENT '默认为0:大小写不敏感,且非HEX;1:HEX格式二进制;2:大小写敏感,且非HEX',
|
||||||
|
`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,
|
||||||
|
`ratelimit` varchar(10) DEFAULT NULL COMMENT '限速比例,0到1之间',
|
||||||
|
`region_id` int(11) NOT NULL,
|
||||||
|
`group_id` int(11) NOT NULL,
|
||||||
|
`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',
|
||||||
|
PRIMARY KEY (`cfg_id`) USING BTREE,
|
||||||
|
KEY `http_url_cfg_compileId` (`compile_id`),
|
||||||
|
KEY `http_url_cfg_functionId` (`function_id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
|
||||||
|
|
||||||
|
CREATE TABLE `scriberid_comm_cfg` (
|
||||||
|
`cfg_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键,自增',
|
||||||
|
`cfg_desc` varchar(128) DEFAULT NULL,
|
||||||
|
`cfg_keywords` varchar(2048) NOT NULL,
|
||||||
|
`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删除;1) 未审核时配置可删除;2) 审核通过,此字段置1;3) 取消审核通过,此字段置0',
|
||||||
|
`is_audit` int(11) NOT NULL COMMENT '0未审核,1审核通过,2审核未通过,3取消审核通过;1) 审核未通过,配置可修改;2) 审核通过,配置不可删除,只能取消审核通过',
|
||||||
|
`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) NOT 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,多个用英文逗号分隔',
|
||||||
|
`expr_type` int(11) NOT NULL COMMENT '0:无表达式,1:与表达式',
|
||||||
|
`match_method` int(11) NOT NULL COMMENT 'expr_type:0时有意义,其它情况必须置0。0:子串匹配;1:右匹配;2:左匹配;3:完全匹配',
|
||||||
|
`is_hexbin` int(11) NOT NULL COMMENT '默认为0:大小写不敏感,且非HEX;1:HEX格式二进制;2:大小写敏感,且非HEX',
|
||||||
|
`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,
|
||||||
|
`ratelimit` varchar(10) DEFAULT NULL COMMENT '限速比例,0到1之间',
|
||||||
|
`region_id` int(11) NOT NULL,
|
||||||
|
`group_id` int(11) NOT NULL,
|
||||||
|
`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',
|
||||||
|
PRIMARY KEY (`cfg_id`) USING BTREE,
|
||||||
|
KEY `http_url_cfg_compileId` (`compile_id`),
|
||||||
|
KEY `http_url_cfg_functionId` (`function_id`)
|
||||||
|
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
|
||||||
@@ -1,20 +1,21 @@
|
|||||||
# 菜单
|
# 菜单
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('717', '0,1,86,717,', 'ip_group_configuration', 'IP公共组管理', '340', '/basics/ip/list', '', '', '1', 'ip:common:config', '1', '2019-05-27 14:06:23', '1', '2019-05-27 14:37:33', '', '1', NULL, '0', '0', '605');
|
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('717', '0,1,86,717,', 'ip_group_configuration', 'IP公共组管理', '340', '/basics/ip/list', '', '', '1', 'ip:common:config', '1', '2019-05-27 14:06:23', '1', '2019-05-27 14:37:33', '', '1', NULL, '0', '0', '605');
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('750', '0,1,150,750,', 'ip_group_configuration', 'IP公共组管理', '490', '/basics/ip/list', '', '', '1', 'ip:common:confirm', '1', '2019-05-27 14:08:56', '1', '2019-05-27 14:37:53', '', '1', NULL, '0', '0', '605');
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('865', '0,1,151,865,', 'ip_group_configuration', 'IP公共组管理', '490', '/basics/ip/list', '', '', '1', 'ip:common:audit', '1', '2019-05-27 14:09:45', '1', '2019-05-27 14:38:11', '', '1', NULL, '0', '0', '605');
|
|
||||||
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('717', '0,1,86,717,', 'url_group_configuration', 'URL公共组管理', '350', '/basics/url/list', '', '', '1', 'url:common:config', '1', '2019-05-27 15:54:43', '1', '2019-05-27 15:55:05', '', '1', NULL, '0', '0', '606');
|
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('717', '0,1,86,717,', 'url_group_configuration', 'URL公共组管理', '350', '/basics/url/list', '', '', '1', 'url:common:config', '1', '2019-05-27 15:54:43', '1', '2019-05-27 15:55:05', '', '1', NULL, '0', '0', '606');
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('750', '0,1,150,750,', 'ip_group_configuration', 'URL公共组管理', '500', '/basics/url/list', '', '', '1', 'url:common:confirm', '1', '2019-05-27 15:55:58', '1', '2019-05-27 15:55:58', '', '1', NULL, '0', '0', '606');
|
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('717', '0,1,86,717,', 'domain_group_configuration', '域名公共组管理', '360', '/basics/domain/list', '', '', '1', 'domain:common:config', '1', '2019-06-06 15:18:43', '1', '2019-06-06 15:18:43', '', '1', NULL, '0', '0', '607');
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('865', '0,1,151,865,', 'url_group_configuration', 'URL公共组管理', '500', '/basics/url/list', '', '', '1', 'url:common:audit', '1', '2019-05-27 15:56:47', '1', '2019-05-27 15:56:47', '', '1', NULL, '0', '0', '606');
|
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('717', '0,1,86,717,', 'scriberid_group_configuration', '账号公共组管理', '370', '/basics/scriberId/list', '', '', '1', 'scriberid:common:config', '1', '2019-06-06 15:20:51', '1', '2019-06-06 15:20:51', '', '1', NULL, '0', '0', '608');
|
||||||
|
|
||||||
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('109', '0,1,109,', 'common_group_manage', '公共组管理', '5090', '/basics/commonGroup/list', '', 'fa fa-object-ungroup', '1', '', '1', '2019-05-27 16:15:23', '1', '2019-05-28 15:28:59', '', '1', NULL, '0', '0', NULL);
|
INSERT INTO `sys_menu` (`parent_id`, `parent_ids`, `code`, `name`, `sort`, `href`, `target`, `icon`, `is_show`, `permission`, `create_by`, `create_date`, `update_by`, `update_date`, `remarks`, `del_flag`, `menu_bg`, `quick_action`, `is_top`, `function_id`) VALUES ('109', '0,1,109,', 'common_group_manage', '公共组管理', '5090', '/basics/commonGroup/list', '', 'fa fa-object-ungroup', '1', '', '1', '2019-05-27 16:15:23', '1', '2019-05-28 15:28:59', '', '1', NULL, '0', '0', NULL);
|
||||||
|
|
||||||
# 配置
|
# 配置
|
||||||
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`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('605', '', '1', 'IP_COMMON_GROUP', 'IP公共组管理', '1', '1', '1', NULL, '2019-05-27 14:50:16', NULL, NULL, '', '', '', '4,6', '', '', '1,2,3;1,2,3', '1,2;1,2', '0,1', '0,6,17', '1,2,3,4', '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`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('605', '', '1', 'IP_COMMON_GROUP', 'IP公共组管理', '1', '1', '1', NULL, '2019-05-27 14:50:16', NULL, NULL, '', '', '', '4,6', '', '', '1,2,3;1,2,3', '1,2;1,2', '0,1', '0,6,17', '1,2,3,4', '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`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('606', '', '2', 'URL_COMMON_GROUP', 'URL公共组管理', '1', '1', '2', NULL, '2019-05-27 16:00:39', NULL, NULL, '', '0,1', '0,1,2,3', '', '0', '1', NULL, NULL, NULL, NULL, NULL, '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`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('606', '', '2', 'URL_COMMON_GROUP', 'URL公共组管理', '1', '1', '2', NULL, '2019-05-27 16:00:39', NULL, NULL, '', '0,1', '0,1,2,3', '', '0', '1', NULL, NULL, NULL, NULL, NULL, '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`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('607', '', '1', 'DOMAIN_COMMON_GROUP', '域名公共组管理', '1', '1', '2', NULL, '2019-06-06 14:43:53', NULL, NULL, '', '0', '1,3', '', '2', '0', NULL, NULL, NULL, NULL, NULL, '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`, `editor_id`, `edit_time`, `config_service_type`, `config_expr_type`, `config_match_method`, `config_ip_type`, `config_hex`, `config_multi_keywords`, `config_ip_pattern`, `config_port_pattern`, `config_direction`, `config_protocol`, `config_ip_port_show`, `config_region_sort`, `is_import`) VALUES ('608', '', '1', 'SCRIBERID_COMMON_GROUP', '账号公共组管理', '1', '1', '2', NULL, '2019-06-06 15:32:02', NULL, NULL, '', '0', '3', '', '0', '0', NULL, NULL, NULL, NULL, NULL, '1', '1');
|
||||||
|
|
||||||
INSERT INTO `function_service_dict` (`function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`, `is_import`, `sort`, `config_do_log`) VALUES ('605', '0', '1', 'monit', '0', 'ip_common_group', NULL, '1', '1', '2019-05-27 14:47:47', NULL, NULL, '1', '1', '0', '0;2;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`, `editor_id`, `edit_time`, `region_code`, `is_import`, `sort`, `config_do_log`) VALUES ('605', '0', '1', 'monit', '0', 'ip_common_group', NULL, '1', '1', '2019-05-27 14:47:47', NULL, NULL, '1', '1', '0', NULL);
|
||||||
INSERT INTO `function_service_dict` (`function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`, `is_import`, `sort`, `config_do_log`) VALUES ('606', '0', '1', 'monit', '0', 'url_common_group', NULL, '1', '1', '2019-05-27 15:59:43', NULL, NULL, '2', '1', '0', NULL);
|
INSERT INTO `function_service_dict` (`function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`, `is_import`, `sort`, `config_do_log`) VALUES ('606', '0', '1', 'monit', '0', 'url_common_group', NULL, '1', '1', '2019-05-27 15:59:43', NULL, NULL, '2', '1', '0', NULL);
|
||||||
|
INSERT INTO `function_service_dict` (`function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`, `is_import`, `sort`, `config_do_log`) VALUES ('607', '0', '1', 'monit', '0', 'domain_common_group', '', '1', NULL, '2019-06-06 15:24:56', NULL, NULL, '2', '1', '0', NULL);
|
||||||
|
INSERT INTO `function_service_dict` (`function_id`, `protocol_id`, `action`, `action_code`, `service_id`, `service_name`, `service_desc`, `is_valid`, `creator_id`, `create_time`, `editor_id`, `edit_time`, `region_code`, `is_import`, `sort`, `config_do_log`) VALUES ('608', '0', '1', 'monit', '0', 'scriberid_common_group', NULL, '1', NULL, '2019-06-06 15:24:52', NULL, NULL, '2', '1', '0', NULL);
|
||||||
|
|
||||||
|
|
||||||
# 字典
|
# 字典
|
||||||
@@ -36,8 +37,27 @@ VALUES
|
|||||||
'1',
|
'1',
|
||||||
'1',
|
'1',
|
||||||
(SELECT id FROM sys_data_dictionary_name WHERE mark = 'GROUP_TYPE')
|
(SELECT id FROM sys_data_dictionary_name WHERE mark = 'GROUP_TYPE')
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'8',
|
||||||
|
'DOMAIN GROUP',
|
||||||
|
'普通域名组',
|
||||||
|
'0',
|
||||||
|
'1',
|
||||||
|
'1',
|
||||||
|
(SELECT id FROM sys_data_dictionary_name WHERE mark = 'GROUP_TYPE')
|
||||||
|
),
|
||||||
|
(
|
||||||
|
'9',
|
||||||
|
'SCRIBERID GROUP',
|
||||||
|
'普通账号组',
|
||||||
|
'0',
|
||||||
|
'1',
|
||||||
|
'1',
|
||||||
|
(SELECT id FROM sys_data_dictionary_name WHERE mark = 'GROUP_TYPE')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
# 修改表字段注释
|
# 修改表字段注释
|
||||||
ALTER TABLE policy_group_info MODIFY COLUMN group_type INT(2) DEFAULT NULL COMMENT '1:dns 2:ip复用, 4:asn, 5:IP通用组, 7:URL通用组, 8:Domain通用组, 9:SubscribeId通用组',
|
ALTER TABLE policy_group_info MODIFY COLUMN group_type INT(2) DEFAULT NULL COMMENT '1:dns 2:ip复用, 4:asn, 5:IP通用组, 7:URL通用组, 8:Domain通用组, 9:SubscribeId通用组',
|
||||||
MODIFY COLUMN ud_flag INT(2) NOT NULL DEFAULT 0 COMMENT '0:不可用,1:未被引用(可用),2:已被引用(可用)|默认0';
|
MODIFY COLUMN ud_flag INT(2) NOT NULL DEFAULT 0 COMMENT '0:不可用,1:未被引用(可用),2:已被引用(可用)|默认0';
|
||||||
@@ -86,6 +86,10 @@ DELETE FROM PXY_PROFILE_INSERT_SCRIPTS;
|
|||||||
DELETE FROM PXY_PROFILE_HIJACK_FILES;
|
DELETE FROM PXY_PROFILE_HIJACK_FILES;
|
||||||
DELETE FROM PXY_PROFILE_TRAFFIC_MIRROR;
|
DELETE FROM PXY_PROFILE_TRAFFIC_MIRROR;
|
||||||
DELETE FROM PXY_PROFILE_RESPONSE_PAGES;
|
DELETE FROM PXY_PROFILE_RESPONSE_PAGES;
|
||||||
|
DELETE FROM ip_comm_cfg;
|
||||||
|
DELETE FROM url_comm_cfg;
|
||||||
|
DELETE FROM domain_comm_cfg;
|
||||||
|
DELETE FROM scriberid_comm_cfg;
|
||||||
DELETE FROM schedule_cfg;
|
DELETE FROM schedule_cfg;
|
||||||
DELETE FROM schedule_exce_log;
|
DELETE FROM schedule_exce_log;
|
||||||
DELETE FROM schedule_exce_new;
|
DELETE FROM schedule_exce_new;
|
||||||
|
|||||||
@@ -173,11 +173,11 @@
|
|||||||
|
|
||||||
<!-- 600 asn ip、 3:IP白名单、 405:APP协议IP、 403:APP域名特征、 563 APP Payload、 565 APP HTTP、 564 APP DNS、 566 APP SSL -->
|
<!-- 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) ||
|
<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 605) || (cfg.functionId eq 606) || (cfg.functionId eq 607) || (cfg.functionId eq 608) }">
|
||||||
<div class="row hidden requestIdSel">
|
<div class="row hidden requestIdSel">
|
||||||
</c:if>
|
</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) &&
|
<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) &&
|
||||||
(cfg.functionId ne 560) }">
|
(cfg.functionId ne 560) && (cfg.functionId ne 605) && (cfg.functionId ne 606) && (cfg.functionId ne 607) && (cfg.functionId ne 608) }">
|
||||||
<div class="row requestIdSel">
|
<div class="row requestIdSel">
|
||||||
</c:if>
|
</c:if>
|
||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="letter"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="letter"/></label>
|
||||||
@@ -274,7 +274,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</br>
|
</br>
|
||||||
</c:if>
|
</c:if>
|
||||||
<div class="row">
|
<div class="row isSendDiv">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="examine"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="examine"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<!-- 拥有配置新增直接生效的功能权限导入时默认导入+下发 -->
|
<!-- 拥有配置新增直接生效的功能权限导入时默认导入+下发 -->
|
||||||
|
|||||||
@@ -70,9 +70,10 @@ $(function(){
|
|||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="group_type"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="group_type"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select id="groupType" name="groupType" class="selectpicker select2 form-control required" >
|
<select id="groupType" name="groupType" class="selectpicker select2 form-control required" >
|
||||||
|
<option value="" ><spring:message code="select"/></option>
|
||||||
<c:forEach items="${fns:getDictList('GROUP_TYPE')}" var="groupTypeC">
|
<c:forEach items="${fns:getDictList('GROUP_TYPE')}" var="groupTypeC">
|
||||||
<c:if test="${groupTypeC.itemCode eq 5 || groupTypeC.itemCode eq 7 || groupTypeC.itemCode eq 8 || groupTypeC.itemCode eq 9}">
|
<c:if test="${groupTypeC.itemCode eq 5 || groupTypeC.itemCode eq 7 || groupTypeC.itemCode eq 8 || groupTypeC.itemCode eq 9}">
|
||||||
<option value="${groupTypeC.itemCode}" <c:if test="${_cfg.groupType==groupTypeC.itemCode || (_cfg.groupType==null && groupTypeC.itemCode==1)}">selected</c:if>><spring:message code="${groupTypeC.itemValue}"/></option>
|
<option value="${groupTypeC.itemCode}" <c:if test="${_cfg.groupType==groupTypeC.itemCode}">selected</c:if>><spring:message code="${groupTypeC.itemValue}"/></option>
|
||||||
</c:if>
|
</c:if>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
@@ -33,13 +33,13 @@
|
|||||||
function deletes(url){
|
function deletes(url){
|
||||||
var checkboxes = $("tbody tr td input.i-checks:checkbox");
|
var checkboxes = $("tbody tr td input.i-checks:checkbox");
|
||||||
var ids = "";
|
var ids = "";
|
||||||
var str = "";
|
var groupTypes = "";
|
||||||
var canDel = true;
|
var canDel = true;
|
||||||
|
|
||||||
checkboxes.each(function(){
|
checkboxes.each(function(){
|
||||||
if(true == $(this).is(':checked')){
|
if(true == $(this).is(':checked')){
|
||||||
str += $(this).attr("id")+"_"+$(this).attr("groupType")+",";
|
|
||||||
ids += $(this).attr("id")+",";
|
ids += $(this).attr("id")+",";
|
||||||
|
groupTypes += $(this).attr("groupType")+",";
|
||||||
if($(this).attr("udFlag") != 0){ // 存在被引用的分组
|
if($(this).attr("udFlag") != 0){ // 存在被引用的分组
|
||||||
canDel = false;
|
canDel = false;
|
||||||
return false;
|
return false;
|
||||||
@@ -48,19 +48,19 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// 去除末尾,
|
// 去除末尾,
|
||||||
if(str.substr(str.length-1)== ','){
|
|
||||||
str = str.substr(0,str.length-1);
|
|
||||||
}
|
|
||||||
if(ids.substr(ids.length-1)== ','){
|
if(ids.substr(ids.length-1)== ','){
|
||||||
ids = ids.substr(0,ids.length-1);
|
ids = ids.substr(0,ids.length-1);
|
||||||
}
|
}
|
||||||
|
if(groupTypes.substr(groupTypes.length-1)== ','){
|
||||||
|
groupTypes = groupTypes.substr(0,groupTypes.length-1);
|
||||||
|
}
|
||||||
|
|
||||||
if(str.length >0){
|
if(ids.length >0){
|
||||||
var tip='<spring:message code="can_not_delete_issued_group"/>';
|
var tip='<spring:message code="can_not_delete_issued_group"/>';
|
||||||
if(canDel){
|
if(canDel){
|
||||||
top.$.jBox.confirm("<spring:message code='confirm_message'/>","<spring:message code='info'/>",function(v,h,f){
|
top.$.jBox.confirm("<spring:message code='confirm_message'/>","<spring:message code='info'/>",function(v,h,f){
|
||||||
if(v=="ok"){
|
if(v=="ok"){
|
||||||
window.location = url+"&ids="+ids;
|
window.location = url+"&ids="+ids+"&groupTypes="+groupTypes;
|
||||||
}
|
}
|
||||||
},{buttonsFocus:1});
|
},{buttonsFocus:1});
|
||||||
top.$('.jbox-body .jbox-icon').css('top','55px');
|
top.$('.jbox-body .jbox-icon').css('top','55px');
|
||||||
|
|||||||
330
src/main/webapp/WEB-INF/views/basics/domainCommGroupFormAdd.jsp
Normal file
330
src/main/webapp/WEB-INF/views/basics/domainCommGroupFormAdd.jsp
Normal file
@@ -0,0 +1,330 @@
|
|||||||
|
<%@ 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;
|
||||||
|
$(function(){
|
||||||
|
defaultIpInfo=$(".strInfo").clone(true);
|
||||||
|
|
||||||
|
$(".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){
|
||||||
|
var flag = true;
|
||||||
|
$(".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(true);
|
||||||
|
additional.removeClass("hidden").removeClass("disabled");
|
||||||
|
// 因clone()无法复制标签js动态绑定的事件,新增标签时需重新添加
|
||||||
|
$(".strInfo").find(".domainCheck").each(function(){
|
||||||
|
var blurValue = $(this).attr("onblur");
|
||||||
|
var keypressValue = $(this).attr("onkeypress");
|
||||||
|
if(typeof(blurValue) != "undefined"){
|
||||||
|
$(additional).find(".domainCheck").each(function(){
|
||||||
|
this.setAttribute("onblur",blurValue);
|
||||||
|
this.setAttribute("onkeypress",keypressValue);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
showDiv.after(additional);
|
||||||
|
}
|
||||||
|
var index=0;
|
||||||
|
$("."+contentClassName).each(function(){
|
||||||
|
reSort($(this),index);
|
||||||
|
$("input[name='domainCommGroupList["+index+"].cfgKeywords']").attr("id","tags_"+index);
|
||||||
|
index++;
|
||||||
|
});
|
||||||
|
$(".selectpicker").selectpicker("render");
|
||||||
|
}
|
||||||
|
|
||||||
|
//业务窗口关闭
|
||||||
|
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("domainCommGroupList[")>-1){
|
||||||
|
var namePrefix="domainCommGroupList[";
|
||||||
|
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>
|
||||||
|
<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="domain_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/domain/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="group_name"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="groupId" 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="groupInfo">
|
||||||
|
<option value="${groupInfo.serviceGroupId}">${groupInfo.groupName}</option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="groupId"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- desc and action -->
|
||||||
|
<h4 class="form-section">
|
||||||
|
<spring:message code="domain_name" />
|
||||||
|
<small> <span
|
||||||
|
class="glyphicon glyphicon-plus asnIpAdd"
|
||||||
|
onClick="addContent(this,'strInfo')" title="add"></span></small>
|
||||||
|
</h4>
|
||||||
|
<div id="strInfo" 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">
|
||||||
|
|
||||||
|
<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="keyword" />
|
||||||
|
</label>
|
||||||
|
<!-- 此配置的关键词可以输入多个关键词 -->
|
||||||
|
<c:if test="${region.configMultiKeywords eq 1}">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input class="form-control required tags domainCheck" type="text" id="tags_${status.index}" name="domainCommGroupList[-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 domainCheck" type="text" name="domainCommGroupList[-1].cfgKeywords">
|
||||||
|
</div>
|
||||||
|
</c:if>
|
||||||
|
<div for="domainCommGroupList[-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="domainCommGroupList[-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="domainCommGroupList[-1].exprType" value="${exprTypeC.itemCode }"
|
||||||
|
class="required" checked >
|
||||||
|
<spring:message code="${exprTypeC.itemValue }" />
|
||||||
|
</label>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:if>
|
||||||
|
</div>
|
||||||
|
<div for="domainCommGroupList[-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="domainCommGroupList[-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="domainCommGroupList[-1].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>
|
||||||
@@ -0,0 +1,270 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><spring:message code="domain_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){
|
||||||
|
var flag = true;
|
||||||
|
$(".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="domain_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/domain/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" name="userRegion1" value="${_cfg.groupId}">
|
||||||
|
<!-- 配置域类型 -->
|
||||||
|
<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="group_name"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="groupId" 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="groupInfo">
|
||||||
|
<option value="${groupInfo.serviceGroupId}"
|
||||||
|
<c:if test="${_cfg.groupId eq groupInfo.serviceGroupId }">
|
||||||
|
selected
|
||||||
|
</c:if>
|
||||||
|
>${groupInfo.groupName}</option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="groupId"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- desc and action -->
|
||||||
|
<h4 class="form-section">
|
||||||
|
<spring:message code="domain_name" />
|
||||||
|
</h4>
|
||||||
|
<div class="boxSolid">
|
||||||
|
<div class="row" style="height: 15px;"></div>
|
||||||
|
<c:forEach items="${regionList}" var="region" varStatus="status">
|
||||||
|
<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 domainCheck" 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 domainCheck"
|
||||||
|
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}"
|
||||||
|
<c:if test="${_cfg.matchMethod eq matchMethod}">
|
||||||
|
selected
|
||||||
|
</c:if>
|
||||||
|
>
|
||||||
|
<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>
|
||||||
256
src/main/webapp/WEB-INF/views/basics/domainCommGroupList.jsp
Normal file
256
src/main/webapp/WEB-INF/views/basics/domainCommGroupList.jsp
Normal file
@@ -0,0 +1,256 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><spring:message code="domain_group_configuration"></spring:message></title>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
//搜索框提示语初始化
|
||||||
|
if("${cfg.cfgDesc}"){
|
||||||
|
$("#intype").val("${cfg.cfgDesc}");
|
||||||
|
}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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改导入Form表单action
|
||||||
|
var importPath="/basics/domain/list?functionId=${cfg.functionId}"
|
||||||
|
$("#importForm1").attr("action","${ctx}/basics/domain/import?importPath="+importPath);
|
||||||
|
|
||||||
|
$(".groupId").find("option:first").each(function(){
|
||||||
|
$(this).hide();
|
||||||
|
$(".groupId").selectpicker("refresh");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
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="domain:common:config">
|
||||||
|
<button type="button" class="btn btn-primary" onClick="javascript:window.location='${ctx}/basics/domain/addForm?functionId=${cfg.functionId}'">
|
||||||
|
<i class="fa fa-plus"></i>
|
||||||
|
<spring:message code="add"></spring:message>
|
||||||
|
</button>
|
||||||
|
<c:set var="serviceImport" value="false"></c:set>
|
||||||
|
<c:forEach items="${serviceList}" var="service" >
|
||||||
|
<c:if test="${(cfg.functionId eq service.functionId) && service.isImport eq 1}">
|
||||||
|
<c:set var="serviceImport" value="true"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<c:if test="${serviceImport 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="domain_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/domain/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">
|
||||||
|
<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="cfgKeywords"><spring:message code="key_word"/></form:option>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
<input id="intype" class="form-control input-medium" type="text" value="" >
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pull-left">
|
||||||
|
<form:select path="groupId" class="selectpicker select2 input-small groupId" data-live-search="true" data-live-search-placeholder="search">
|
||||||
|
<form:option value=""><spring:message code='group_name'/></form:option>
|
||||||
|
<c:forEach items="${policyGroupInfos}" var="policyGroup">
|
||||||
|
<form:option value="${policyGroup.serviceGroupId}"><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="domain:common:config">
|
||||||
|
<sys:delRow url="${ctx}/basics/domain/updateForm?functionId=${cfg.functionId}" id="contentTable" label="update"></sys:delRow>
|
||||||
|
<sys:delRow url="${ctx}/basics/domain/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/domain/exportGroupInfo?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/basics/domain/list?functionId=${cfg.functionId}" id="contentTable" maxRow="5" label="cfg_excel"></sys:delRow></li>
|
||||||
|
<li><sys:delRow url="${ctx}/basics/domain/exportGroupInfo?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/basics/domain/list?functionId=${cfg.functionId}" id="contentTable" maxRow="5" label="cfg_csv"></sys:delRow></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
</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 column="config_describe" ><spring:message code="config_describe"/></th>
|
||||||
|
<th class="sort-column r.group_id" column="groupId"><spring:message code="group_name"/></th>
|
||||||
|
<th class="sort-column cfg_keywords"><spring:message code="key_word"/></th>
|
||||||
|
<th column="match_method" ><spring:message code="match_method"/></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>
|
||||||
|
</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}" compileId="${cfg.groupId}"></td>
|
||||||
|
<td>${cfg.cfgDesc }</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${policyGroupInfos}" var="info">
|
||||||
|
<c:if test="${cfg.groupId eq info.serviceGroupId }">
|
||||||
|
<spring:message code="${info.groupName }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td>${cfg.cfgKeywords }</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
|
||||||
|
<c:if test="${matchMethodC.itemCode eq cfg.matchMethod}">
|
||||||
|
<spring:message code="${matchMethodC.itemValue}"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</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>
|
||||||
|
</tr>
|
||||||
|
</c:forEach>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div class="page">${page}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<c:set var="importPath" value="/basics/domain/list?functionId=${cfg.functionId}"/>
|
||||||
|
<!-- 模板导入,start -->
|
||||||
|
<%@include file="/WEB-INF/include/excel/importModal.jsp" %>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -136,7 +136,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_group"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="group_name"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="groupId" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
<select name="groupId" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||||
<option value=""><spring:message code="select"/></option>
|
<option value=""><spring:message code="select"/></option>
|
||||||
@@ -150,7 +150,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<h4 class="form-section">
|
<h4 class="form-section">
|
||||||
<spring:message code="http_ip_title" />
|
<spring:message code="ip" />
|
||||||
<small> <span
|
<small> <span
|
||||||
class="glyphicon glyphicon-plus ipAdd"
|
class="glyphicon glyphicon-plus ipAdd"
|
||||||
onClick="addContent(this,'ipInfo')" title="add"></span></small>
|
onClick="addContent(this,'ipInfo')" title="add"></span></small>
|
||||||
|
|||||||
@@ -89,7 +89,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_group"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="group_name"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<%-- <input class="form-control required digits asnMustExists" type="text" name="${cfgName}.cfgKeywords" value="${cfg.cfgKeywords}" ctx="${ctx}"> --%>
|
<%-- <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">
|
<select name="groupId" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||||
@@ -130,7 +130,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h4 class="form-section">
|
<h4 class="form-section">
|
||||||
<spring:message code="http_ip_title" />
|
<spring:message code="ip" />
|
||||||
</h4>
|
</h4>
|
||||||
<div class="row ipInfo boxSolid">
|
<div class="row ipInfo boxSolid">
|
||||||
<div class="row" style="height: 15px;"></div>
|
<div class="row" style="height: 15px;"></div>
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
//搜索框提示语初始化
|
//搜索框提示语初始化
|
||||||
if("${cfg.cfgDesc}"){
|
if("${cfg.cfgDesc}"){
|
||||||
$("#intype").val("${cfg.cfgDesc}");
|
$("#intype").val("${cfg.cfgDesc}");
|
||||||
|
}else if("${cfg.srcIpAddress}"){
|
||||||
|
$("#intype").val("${cfg.srcIpAddress}");
|
||||||
}else if("${cfg.destIpAddress}"){
|
}else if("${cfg.destIpAddress}"){
|
||||||
$("#intype").val("${cfg.destIpAddress}");
|
$("#intype").val("${cfg.destIpAddress}");
|
||||||
}else{
|
}else{
|
||||||
@@ -121,8 +123,8 @@
|
|||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<form:select path="seltype" class="selectpicker select2 input-small" >
|
<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="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="srcIpAddress"><spring:message code="client_ip"></spring:message></form:option>
|
||||||
<%-- <form:option value="isValid"><spring:message code="valid_identifier"></spring:message></form:option> --%>
|
<form:option value="destIpAddress"><spring:message code="server_ip"></spring:message></form:option>
|
||||||
</form:select>
|
</form:select>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -138,7 +140,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
<form:select path="groupId" class="selectpicker select2 input-small" data-live-search="true" data-live-search-placeholder="search">
|
<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>
|
<form:option value=""><spring:message code='group_name'/></form:option>
|
||||||
<c:forEach items="${policyGroupInfos}" var="policyGroup">
|
<c:forEach items="${policyGroupInfos}" var="policyGroup">
|
||||||
<form:option value="${policyGroup.serviceGroupId}"><spring:message code='${policyGroup.groupName}'/></form:option>
|
<form:option value="${policyGroup.serviceGroupId}"><spring:message code='${policyGroup.groupName}'/></form:option>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
|
|||||||
@@ -0,0 +1,319 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><spring:message code="scriberid_group_configuration"></spring:message></title>
|
||||||
|
<script type="text/javascript">
|
||||||
|
var defaultIpInfo;
|
||||||
|
$(function(){
|
||||||
|
defaultIpInfo=$(".strInfo").clone(true);
|
||||||
|
|
||||||
|
$(".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){
|
||||||
|
var flag = true;
|
||||||
|
$(".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(true);
|
||||||
|
additional.removeClass("hidden").removeClass("disabled");
|
||||||
|
showDiv.after(additional);
|
||||||
|
}
|
||||||
|
var index=0;
|
||||||
|
$("."+contentClassName).each(function(){
|
||||||
|
reSort($(this),index);
|
||||||
|
$("input[name='scriberIdCommGroupList["+index+"].cfgKeywords']").attr("id","tags_"+index);
|
||||||
|
index++;
|
||||||
|
});
|
||||||
|
$(".selectpicker").selectpicker("render");
|
||||||
|
}
|
||||||
|
|
||||||
|
//业务窗口关闭
|
||||||
|
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("scriberIdCommGroupList[")>-1){
|
||||||
|
var namePrefix="scriberIdCommGroupList[";
|
||||||
|
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>
|
||||||
|
<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="scriberid_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/scriberId/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="group_name"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="groupId" 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="groupInfo">
|
||||||
|
<option value="${groupInfo.serviceGroupId}">${groupInfo.groupName}</option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="groupId"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- desc and action -->
|
||||||
|
<h4 class="form-section">
|
||||||
|
<spring:message code="NTC_SUBSCRIBE_ID" />
|
||||||
|
<small> <span
|
||||||
|
class="glyphicon glyphicon-plus asnIpAdd"
|
||||||
|
onClick="addContent(this,'strInfo')" title="add"></span></small>
|
||||||
|
</h4>
|
||||||
|
<div id="strInfo" 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">
|
||||||
|
|
||||||
|
<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="keyword" />
|
||||||
|
</label>
|
||||||
|
<!-- 此配置的关键词可以输入多个关键词 -->
|
||||||
|
<c:if test="${region.configMultiKeywords eq 1}">
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input class="form-control required tags" type="text" id="tags_${status.index}" name="scriberIdCommGroupList[-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" type="text" name="scriberIdCommGroupList[-1].cfgKeywords">
|
||||||
|
</div>
|
||||||
|
</c:if>
|
||||||
|
<div for="scriberIdCommGroupList[-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="scriberIdCommGroupList[-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="scriberIdCommGroupList[-1].exprType" value="${exprTypeC.itemCode }"
|
||||||
|
class="required" checked >
|
||||||
|
<spring:message code="${exprTypeC.itemValue }" />
|
||||||
|
</label>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</c:if>
|
||||||
|
</div>
|
||||||
|
<div for="scriberIdCommGroupList[-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="scriberIdCommGroupList[-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="scriberIdCommGroupList[-1].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>
|
||||||
@@ -0,0 +1,270 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><spring:message code="scriberid_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){
|
||||||
|
var flag = true;
|
||||||
|
$(".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="scriberid_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/scriberId/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" name="userRegion1" value="${_cfg.groupId}">
|
||||||
|
<!-- 配置域类型 -->
|
||||||
|
<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="group_name"/></label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="groupId" 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="groupInfo">
|
||||||
|
<option value="${groupInfo.serviceGroupId}"
|
||||||
|
<c:if test="${_cfg.groupId eq groupInfo.serviceGroupId }">
|
||||||
|
selected
|
||||||
|
</c:if>
|
||||||
|
>${groupInfo.groupName}</option>
|
||||||
|
</c:forEach>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div for="groupId"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- desc and action -->
|
||||||
|
<h4 class="form-section">
|
||||||
|
<spring:message code="NTC_SUBSCRIBE_ID" />
|
||||||
|
</h4>
|
||||||
|
<div class="boxSolid">
|
||||||
|
<div class="row" style="height: 15px;"></div>
|
||||||
|
<c:forEach items="${regionList}" var="region" varStatus="status">
|
||||||
|
<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" 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"
|
||||||
|
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}"
|
||||||
|
<c:if test="${_cfg.matchMethod eq matchMethod}">
|
||||||
|
selected
|
||||||
|
</c:if>
|
||||||
|
>
|
||||||
|
<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>
|
||||||
256
src/main/webapp/WEB-INF/views/basics/scriberidCommGroupList.jsp
Normal file
256
src/main/webapp/WEB-INF/views/basics/scriberidCommGroupList.jsp
Normal file
@@ -0,0 +1,256 @@
|
|||||||
|
<%@ page contentType="text/html;charset=UTF-8"%>
|
||||||
|
<%@ include file="/WEB-INF/include/taglib.jsp"%>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title><spring:message code="scriberid_group_configuration"></spring:message></title>
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
//搜索框提示语初始化
|
||||||
|
if("${cfg.cfgDesc}"){
|
||||||
|
$("#intype").val("${cfg.cfgDesc}");
|
||||||
|
}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());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//修改导入Form表单action
|
||||||
|
var importPath="/basics/scriberId/list?functionId=${cfg.functionId}"
|
||||||
|
$("#importForm1").attr("action","${ctx}/basics/scriberId/import?importPath="+importPath);
|
||||||
|
|
||||||
|
$(".groupId").find("option:first").each(function(){
|
||||||
|
$(this).hide();
|
||||||
|
$(".groupId").selectpicker("refresh");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
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="scriberid:common:config">
|
||||||
|
<button type="button" class="btn btn-primary" onClick="javascript:window.location='${ctx}/basics/scriberId/addForm?functionId=${cfg.functionId}'">
|
||||||
|
<i class="fa fa-plus"></i>
|
||||||
|
<spring:message code="add"></spring:message>
|
||||||
|
</button>
|
||||||
|
<c:set var="serviceImport" value="false"></c:set>
|
||||||
|
<c:forEach items="${serviceList}" var="service" >
|
||||||
|
<c:if test="${(cfg.functionId eq service.functionId) && service.isImport eq 1}">
|
||||||
|
<c:set var="serviceImport" value="true"></c:set>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
<c:if test="${serviceImport 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="scriberid_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/scriberId/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">
|
||||||
|
<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="cfgKeywords"><spring:message code="key_word"/></form:option>
|
||||||
|
</form:select>
|
||||||
|
</div>
|
||||||
|
<input id="intype" class="form-control input-medium" type="text" value="" >
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="pull-left">
|
||||||
|
<form:select path="groupId" class="selectpicker select2 input-small groupId" data-live-search="true" data-live-search-placeholder="search">
|
||||||
|
<form:option value=""><spring:message code='group_name'/></form:option>
|
||||||
|
<c:forEach items="${policyGroupInfos}" var="policyGroup">
|
||||||
|
<form:option value="${policyGroup.serviceGroupId}"><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="scriberid:common:config">
|
||||||
|
<sys:delRow url="${ctx}/basics/scriberId/updateForm?functionId=${cfg.functionId}" id="contentTable" label="update"></sys:delRow>
|
||||||
|
<sys:delRow url="${ctx}/basics/scriberId/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/scriberId/exportGroupInfo?functionId=${cfg.functionId }&exType=excel" searchUrl="${ctx}/basics/scriberId/list?functionId=${cfg.functionId}" id="contentTable" maxRow="5" label="cfg_excel"></sys:delRow></li>
|
||||||
|
<li><sys:delRow url="${ctx}/basics/scriberId/exportGroupInfo?functionId=${cfg.functionId }&exType=csv" searchUrl="${ctx}/basics/scriberId/list?functionId=${cfg.functionId}" id="contentTable" maxRow="5" label="cfg_csv"></sys:delRow></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<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>
|
||||||
|
</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 column="config_describe" ><spring:message code="config_describe"/></th>
|
||||||
|
<th class="sort-column r.group_id" column="groupId"><spring:message code="group_name"/></th>
|
||||||
|
<th class="sort-column cfg_keywords"><spring:message code="key_word"/></th>
|
||||||
|
<th column="match_method" ><spring:message code="match_method"/></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>
|
||||||
|
</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}" compileId="${cfg.groupId}"></td>
|
||||||
|
<td>${cfg.cfgDesc }</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${policyGroupInfos}" var="info">
|
||||||
|
<c:if test="${cfg.groupId eq info.serviceGroupId }">
|
||||||
|
<spring:message code="${info.groupName }"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</td>
|
||||||
|
<td>${cfg.cfgKeywords }</td>
|
||||||
|
<td>
|
||||||
|
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
|
||||||
|
<c:if test="${matchMethodC.itemCode eq cfg.matchMethod}">
|
||||||
|
<spring:message code="${matchMethodC.itemValue}"/>
|
||||||
|
</c:if>
|
||||||
|
</c:forEach>
|
||||||
|
</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>
|
||||||
|
</tr>
|
||||||
|
</c:forEach>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div class="page">${page}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<c:set var="importPath" value="/basics/scriberId/list?functionId=${cfg.functionId}"/>
|
||||||
|
<!-- 模板导入,start -->
|
||||||
|
<%@include file="/WEB-INF/include/excel/importModal.jsp" %>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -5,12 +5,9 @@
|
|||||||
<title><spring:message code="url_group_configuration"></spring:message></title>
|
<title><spring:message code="url_group_configuration"></spring:message></title>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var defaultIpInfo;
|
var defaultIpInfo;
|
||||||
var protectedList = [".com"];
|
|
||||||
$(function(){
|
$(function(){
|
||||||
|
|
||||||
defaultIpInfo=$(".strInfo").clone(true);
|
defaultIpInfo=$(".strInfo").clone(true);
|
||||||
|
|
||||||
// reSort($(defaultIpInfo),-1);
|
|
||||||
$(".asnIpAdd").click();
|
$(".asnIpAdd").click();
|
||||||
$("#cfgFrom").validate({
|
$("#cfgFrom").validate({
|
||||||
errorPlacement: function(error,element){
|
errorPlacement: function(error,element){
|
||||||
@@ -21,19 +18,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
submitHandler: function(form){
|
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;
|
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(){
|
$(".tagsinput:visible").each(function(){
|
||||||
var text='';
|
var text='';
|
||||||
$(this).find(".tag").each(function(){
|
$(this).find(".tag").each(function(){
|
||||||
@@ -62,18 +47,15 @@
|
|||||||
var addContent = function(obj, contentClassName) {
|
var addContent = function(obj, contentClassName) {
|
||||||
var showDiv = $(obj).parent().parent().siblings("."+contentClassName).last();
|
var showDiv = $(obj).parent().parent().siblings("."+contentClassName).last();
|
||||||
if(showDiv.hasClass("hidden")){
|
if(showDiv.hasClass("hidden")){
|
||||||
$(showDiv).removeClass("hidden").removeClass(
|
$(showDiv).removeClass("hidden").removeClass("disabled");
|
||||||
"disabled");
|
|
||||||
}else{
|
}else{
|
||||||
var additional=defaultIpInfo.clone();
|
var additional=defaultIpInfo.clone();
|
||||||
additional.removeClass("hidden").removeClass(
|
additional.removeClass("hidden").removeClass("disabled");
|
||||||
"disabled");
|
|
||||||
showDiv.after(additional);
|
showDiv.after(additional);
|
||||||
}
|
}
|
||||||
var index=0;
|
var index=0;
|
||||||
$("."+contentClassName).each(function(){
|
$("."+contentClassName).each(function(){
|
||||||
reSort($(this),index);
|
reSort($(this),index);
|
||||||
// $(".tags").attr("id","tags_"+index);
|
|
||||||
$("input[name='urlCommGroupList["+index+"].cfgKeywords']").attr("id","tags_"+index);
|
$("input[name='urlCommGroupList["+index+"].cfgKeywords']").attr("id","tags_"+index);
|
||||||
index++;
|
index++;
|
||||||
});
|
});
|
||||||
@@ -112,7 +94,6 @@
|
|||||||
var namePrefix="urlCommGroupList[";
|
var namePrefix="urlCommGroupList[";
|
||||||
var nameSubfix=name.substring(name.indexOf("]"));
|
var nameSubfix=name.substring(name.indexOf("]"));
|
||||||
var nameNew=namePrefix+index+nameSubfix;
|
var nameNew=namePrefix+index+nameSubfix;
|
||||||
// $(".tags").attr("id","tags_"+index);
|
|
||||||
if(nameNew!=name){
|
if(nameNew!=name){
|
||||||
$(this).attr("name",nameNew);
|
$(this).attr("name",nameNew);
|
||||||
$(this).parents(".form-group").find("div[for='"+name+"']").attr("for",nameNew);
|
$(this).parents(".form-group").find("div[for='"+name+"']").attr("for",nameNew);
|
||||||
@@ -159,33 +140,18 @@
|
|||||||
maxCount:4,
|
maxCount:4,
|
||||||
onAddTag:function(tag,size){
|
onAddTag:function(tag,size){
|
||||||
var reg = new RegExp(/\t|\r|\n/);
|
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];
|
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);
|
exprTypeChecked(objNamePrefix,size,options);
|
||||||
if($(this).hasClass("urlCheck")){
|
if(size == 1){
|
||||||
protectedListWarn($("#"+$(this).attr("id")+"_tagsinput"),$(this).val(),protectedList);
|
protectedListWarn($(this),"urlCheck");
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
onRemoveTag:function(tag,size){
|
onRemoveTag:function(tag,size){
|
||||||
// $(this).parent(".col-md-6").next("div").html("");
|
|
||||||
//var keywordValue = "";
|
|
||||||
var objNamePrefix = $(this).attr("name").split("cfgKeywords")[0];
|
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);
|
exprTypeChecked(objNamePrefix,size,options);
|
||||||
if($(this).hasClass("urlCheck")){
|
if(size == 1){
|
||||||
protectedListWarn($("#"+$(this).attr("id")+"_tagsinput"),$(this).val(),protectedList);
|
protectedListWarn($(this),"urlCheck");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -269,7 +235,7 @@
|
|||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="url_group"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="group_name"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="groupId" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
<select name="groupId" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||||
<option value=""><spring:message code="select"/></option>
|
<option value=""><spring:message code="select"/></option>
|
||||||
@@ -285,7 +251,7 @@
|
|||||||
|
|
||||||
<!-- desc and action -->
|
<!-- desc and action -->
|
||||||
<h4 class="form-section">
|
<h4 class="form-section">
|
||||||
<spring:message code="http_url_title" />
|
<spring:message code="url" />
|
||||||
<small> <span
|
<small> <span
|
||||||
class="glyphicon glyphicon-plus asnIpAdd"
|
class="glyphicon glyphicon-plus asnIpAdd"
|
||||||
onClick="addContent(this,'strInfo')" title="add"></span></small>
|
onClick="addContent(this,'strInfo')" title="add"></span></small>
|
||||||
@@ -307,12 +273,12 @@
|
|||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font>
|
<label class="control-label col-md-3"><font color="red">*</font>
|
||||||
<spring:message code="keywords" />
|
<spring:message code="keyword" />
|
||||||
</label>
|
</label>
|
||||||
<!-- 此配置的关键词可以输入多个关键词 -->
|
<!-- 此配置的关键词可以输入多个关键词 -->
|
||||||
<c:if test="${region.configMultiKeywords eq 1}">
|
<c:if test="${region.configMultiKeywords eq 1}">
|
||||||
<div class="col-md-6">
|
<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}"
|
<input class="form-control required tags urlCheck" type="text" id="tags_${status.index}"
|
||||||
name="urlCommGroupList[-1].cfgKeywords"
|
name="urlCommGroupList[-1].cfgKeywords"
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
@@ -320,13 +286,7 @@
|
|||||||
<!-- 此配置的关键词不允许输入多个关键词 -->
|
<!-- 此配置的关键词不允许输入多个关键词 -->
|
||||||
<c:if test="${(region.configMultiKeywords eq 0) or (empty region.configMultiKeywords)}">
|
<c:if test="${(region.configMultiKeywords eq 0) or (empty region.configMultiKeywords)}">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input class="form-control required invisibleChar
|
<input class="form-control required invisibleChar urlCheck" type="text" name="urlCommGroupList[-1].cfgKeywords">
|
||||||
<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>
|
</div>
|
||||||
</c:if>
|
</c:if>
|
||||||
<div for="urlCommGroupList[-1].cfgKeywords"></div>
|
<div for="urlCommGroupList[-1].cfgKeywords"></div>
|
||||||
@@ -417,14 +377,6 @@
|
|||||||
|
|
||||||
</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="form-actions">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
|||||||
@@ -119,7 +119,7 @@
|
|||||||
|
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="urlGroup"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="group_name"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<%-- <input class="form-control required digits asnMustExists" type="text" name="${cfgName}.cfgKeywords" value="${cfg.cfgKeywords}" ctx="${ctx}"> --%>
|
<%-- <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">
|
<select name="groupId" data-live-search="true" data-live-search-placeholder="search" class="selectpicker form-control required">
|
||||||
@@ -140,7 +140,7 @@
|
|||||||
|
|
||||||
<!-- desc and action -->
|
<!-- desc and action -->
|
||||||
<h4 class="form-section">
|
<h4 class="form-section">
|
||||||
<spring:message code="http_url_title" />
|
<spring:message code="url" />
|
||||||
<!-- <small> <span
|
<!-- <small> <span
|
||||||
class="glyphicon glyphicon-plus asnIpAdd"
|
class="glyphicon glyphicon-plus asnIpAdd"
|
||||||
onClick="addContent(this,'strInfo')" title="add"></span></small> -->
|
onClick="addContent(this,'strInfo')" title="add"></span></small> -->
|
||||||
|
|||||||
@@ -38,6 +38,10 @@
|
|||||||
$("#exportValue").val($("#intype").val());
|
$("#exportValue").val($("#intype").val());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//修改导入Form表单action
|
||||||
|
var importPath="/basics/url/list?functionId=${cfg.functionId}"
|
||||||
|
$("#importForm1").attr("action","${ctx}/basics/url/import?importPath="+importPath);
|
||||||
});
|
});
|
||||||
var edit=function(url){
|
var edit=function(url){
|
||||||
var cked = $('tbody tr td input.i-checks:checkbox:checked');
|
var cked = $('tbody tr td input.i-checks:checkbox:checked');
|
||||||
@@ -103,7 +107,7 @@
|
|||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<form:select path="seltype" class="selectpicker select2 input-small" >
|
<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="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
|
||||||
<form:option value="cfgKeywords"><spring:message code="URL"/> <spring:message code="key_word"/></form:option>
|
<form:option value="cfgKeywords"><spring:message code="key_word"/></form:option>
|
||||||
</form:select>
|
</form:select>
|
||||||
</div>
|
</div>
|
||||||
<input id="intype" class="form-control input-medium" type="text" value="">
|
<input id="intype" class="form-control input-medium" type="text" value="">
|
||||||
@@ -111,7 +115,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
<form:select path="groupId" class="selectpicker select2 input-small" data-live-search="true" data-live-search-placeholder="search">
|
<form:select path="groupId" class="selectpicker select2 input-small" data-live-search="true" data-live-search-placeholder="search">
|
||||||
<form:option value=""><spring:message code='url_group'/></form:option>
|
<form:option value=""><spring:message code='group_name'/></form:option>
|
||||||
<c:forEach items="${policyGroupInfos}" var="policyGroup">
|
<c:forEach items="${policyGroupInfos}" var="policyGroup">
|
||||||
<form:option value="${policyGroup.serviceGroupId}"><spring:message code='${policyGroup.groupName}'/></form:option>
|
<form:option value="${policyGroup.serviceGroupId}"><spring:message code='${policyGroup.groupName}'/></form:option>
|
||||||
</c:forEach>
|
</c:forEach>
|
||||||
@@ -198,7 +202,7 @@
|
|||||||
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
|
||||||
<th column="config_describe" ><spring:message code="config_describe"/></th>
|
<th column="config_describe" ><spring:message code="config_describe"/></th>
|
||||||
<th class="sort-column r.group_id" column="groupId"><spring:message code="group_name"/></th>
|
<th class="sort-column r.group_id" column="groupId"><spring:message code="group_name"/></th>
|
||||||
<th class="sort-column cfg_keywords"><spring:message code="URL"/> <spring:message code="key_word"/></th>
|
<th class="sort-column cfg_keywords"><spring:message code="key_word"/></th>
|
||||||
<th column="match_method" ><spring:message code="match_method"/></th>
|
<th column="match_method" ><spring:message code="match_method"/></th>
|
||||||
<th column="creator" ><spring:message code="creator"/></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="config_time" class="sort-column create_time"><spring:message code="config_time"/></th>
|
||||||
|
|||||||
@@ -45,6 +45,11 @@ $(function(){
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 分组配置导入 隐藏是否下发选项
|
||||||
|
if($("#functionId").val() == 605 || $("#functionId").val() == 606 || $("#functionId").val() == 607 || $("#functionId").val() == 608){
|
||||||
|
$(".isSendDiv").hide();
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
/**
|
/**
|
||||||
* action动作切换
|
* action动作切换
|
||||||
|
|||||||
Reference in New Issue
Block a user