Merge branch 'develop' of http://192.168.10.125/k18_web/NFS.git into develop
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
/**
|
||||
* EXCEL DomainIntercept 导入模板(监测)
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
public class DomainInterceptMonitTemplate extends StringAllTemplate{
|
||||
|
||||
private String userRegion5;
|
||||
private String cfgKeywords;
|
||||
|
||||
@ExcelField(title="intercept_intensity",dictType="INTERCEPT_DOMAIN_INTENSITY",align=2,sort=2)
|
||||
public String getUserRegion5() {
|
||||
return userRegion5;
|
||||
}
|
||||
|
||||
public void setUserRegion5(String userRegion5) {
|
||||
this.userRegion5 = userRegion5;
|
||||
}
|
||||
|
||||
@ExcelField(title="domain_name",sort=11)
|
||||
public String getCfgKeywords() {
|
||||
return cfgKeywords;
|
||||
}
|
||||
|
||||
public void setCfgKeywords(String cfgKeywords) {
|
||||
this.cfgKeywords = cfgKeywords;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
/**
|
||||
* EXCEL DomainIntercept 导入模板(限速)
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
public class DomainInterceptRateLimitTemplate extends StringAllTemplate{
|
||||
|
||||
private String userRegion2;
|
||||
private String cfgKeywords;
|
||||
|
||||
@ExcelField(title="ratelimit",dictType="RATE_LIMIT",align=2,sort=2)
|
||||
public String getUserRegion2() {
|
||||
return userRegion2;
|
||||
}
|
||||
|
||||
public void setUserRegion2(String userRegion2) {
|
||||
this.userRegion2 = userRegion2;
|
||||
}
|
||||
|
||||
@ExcelField(title="domain_name",sort=11)
|
||||
public String getCfgKeywords() {
|
||||
return cfgKeywords;
|
||||
}
|
||||
|
||||
public void setCfgKeywords(String cfgKeywords) {
|
||||
this.cfgKeywords = cfgKeywords;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.nis.domain.configuration.template;
|
||||
|
||||
import com.nis.util.excel.ExcelField;
|
||||
|
||||
public class DomainInterceptTemplate extends StringAllTemplate{
|
||||
private String cfgKeywords;
|
||||
|
||||
@ExcelField(title="domain_name",sort=11)
|
||||
public String getCfgKeywords() {
|
||||
return cfgKeywords;
|
||||
}
|
||||
|
||||
public void setCfgKeywords(String cfgKeywords) {
|
||||
this.cfgKeywords = cfgKeywords;
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import com.nis.util.excel.ExcelField;
|
||||
public class BaseLogEntity<T> extends BaseEntity<T> {
|
||||
|
||||
private static final long serialVersionUID = 8321337584518281424L;
|
||||
|
||||
@ExcelField(title="cfg_id",sort=1)
|
||||
protected Integer cfgId;
|
||||
@ExcelField(title="found_time",sort=5)
|
||||
protected String foundTime; //发现时间,timestamp
|
||||
@@ -29,6 +29,7 @@ public class BaseLogEntity<T> extends BaseEntity<T> {
|
||||
@Expose
|
||||
@ExcelField(title="client_port",sort=43)
|
||||
protected String sPort; //客户端ip端口
|
||||
|
||||
protected Integer service; //配置表的serviceId
|
||||
@ExcelField(title="entrance_id",dictType="ENTRANCE",sort=7)
|
||||
protected Integer entranceId; //出入口编号
|
||||
@@ -60,6 +61,7 @@ public class BaseLogEntity<T> extends BaseEntity<T> {
|
||||
protected String sceneFile;//现场日志文件地址
|
||||
|
||||
protected Integer functionId;
|
||||
@ExcelField(title="action",dictType="SERVICE_ACTION",sort=2)
|
||||
protected Integer action;
|
||||
|
||||
protected String date;//配置界面日志总量查询时间
|
||||
|
||||
@@ -412,13 +412,18 @@ public class ExcelCsv {
|
||||
public static boolean isDate(String strDate) {
|
||||
Pattern pattern = Pattern
|
||||
.compile("^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\\s(((0?[0-9])|([1-2][0-3]))\\:([0-5]?[0-9])((\\s)|(\\:([0-5]?[0-9])))))?$");
|
||||
Matcher m = pattern.matcher(strDate);
|
||||
if (m.matches()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
if(strDate.length()>= 10){
|
||||
String date=strDate.trim().substring(0, 10);
|
||||
Matcher m = pattern.matcher(date);
|
||||
if (m.matches()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -205,6 +205,28 @@ public class ExportExcel {
|
||||
index++;
|
||||
}
|
||||
}
|
||||
// 拦截强度
|
||||
if("intercept_intensity".equals(headerStr)){
|
||||
commentStr="";
|
||||
List<SysDataDictionaryItem> dict=DictUtils.getDictList("INTERCEPT_DOMAIN_INTENSITY");
|
||||
if(dict !=null && dict.size()>0){
|
||||
for (SysDataDictionaryItem sysDataDictionaryItem : dict) {
|
||||
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+"("+msgProp.getProperty(sysDataDictionaryItem.getItemValue(),sysDataDictionaryItem.getItemValue())+")\n";
|
||||
index++;
|
||||
}
|
||||
//defaultValue=dict.get(0).getItemCode();
|
||||
}
|
||||
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||
index++;
|
||||
/*commentStr=commentStr+"\n"+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
index++;
|
||||
if(!StringUtil.isEmpty(defaultValue)){
|
||||
//1、默认值说明
|
||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
||||
index++;
|
||||
index++;
|
||||
}*/
|
||||
}
|
||||
/***发现内容***/
|
||||
if("replaced_content".equals(headerStr)){
|
||||
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||
@@ -805,6 +827,10 @@ public class ExportExcel {
|
||||
List<SysDataDictionaryItem> protocol=DictUtils.getDictList("PROTOCOL");
|
||||
if(protocol !=null && protocol.size()>0){
|
||||
for (SysDataDictionaryItem sysDataDictionaryItem : protocol) {
|
||||
// IP拦截 监测
|
||||
if((sysDataDictionaryItem.getItemCode().equals("17")) && (region.getFunctionId().equals(200) && service.getAction().equals(1))){
|
||||
continue;
|
||||
}
|
||||
if((","+region.getConfigProtocol()+",").indexOf(","+sysDataDictionaryItem.getItemCode()+",") >-1){
|
||||
if(StringUtil.isEmpty(msgProp.getProperty(sysDataDictionaryItem.getItemValue()))){
|
||||
commentStr=commentStr+sysDataDictionaryItem.getItemCode()+"("+sysDataDictionaryItem.getItemValue()+")"+"\n";
|
||||
|
||||
@@ -93,6 +93,10 @@ public class CheckIpFormatThread implements Callable<String>{
|
||||
String protocol = regionDict.getConfigProtocol();
|
||||
String direction = regionDict.getConfigDirection();
|
||||
StringBuffer errTip = new StringBuffer();
|
||||
// 因IP拦截 监测
|
||||
if(regionDict.getFunctionId().equals(200) && serviceDict.getAction().equals(1)){
|
||||
protocol="6";
|
||||
}
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
StringBuffer errInfo = new StringBuffer();
|
||||
IpPortCfg baseIpCfg = new IpPortCfg();
|
||||
|
||||
@@ -105,8 +105,41 @@ public class CheckStringFormatThread implements Callable<String>{
|
||||
}
|
||||
}
|
||||
}
|
||||
// 代理-域名拦截
|
||||
if (regionDict.getFunctionId().equals(201) && "intercept_domain".equals(regionDict.getConfigServiceType())) {
|
||||
String userRegion5 = baseStringCfg.getUserRegion5();// 拦截强度
|
||||
String userRegion2 = baseStringCfg.getUserRegion2();// 丢包率
|
||||
if (StringUtils.isNotBlank(userRegion5)) {
|
||||
List<SysDataDictionaryItem> dicts = DictUtils.getDictList("INTERCEPT_DOMAIN_INTENSITY");
|
||||
boolean has = false;
|
||||
for (SysDataDictionaryItem dict : dicts) {
|
||||
if (dict.getItemCode().equals(userRegion5)) {
|
||||
has = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!has) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("intercept_intensity") + " ") + ";");
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(userRegion2)) {
|
||||
List<SysDataDictionaryItem> dicts = DictUtils.getDictList("RATE_LIMIT");
|
||||
boolean has = false;
|
||||
for (SysDataDictionaryItem dict : dicts) {
|
||||
if (dict.getItemCode().equals(userRegion2)) {
|
||||
has = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!has) {
|
||||
errInfo.append(String.format(prop.getProperty("is_incorrect"),
|
||||
prop.getProperty("ratelimit") + " ") + ";");
|
||||
}
|
||||
}
|
||||
}
|
||||
String keyword = baseStringCfg.getCfgKeywords();
|
||||
if (!regionDict.getFunctionId().equals(403)) {
|
||||
if (!regionDict.getFunctionId().equals(403) && !regionDict.getFunctionId().equals(201)) {// 201域名拦截
|
||||
if (StringUtils.isBlank(keyword)) {
|
||||
errInfo.append(
|
||||
String.format(prop.getProperty("can_not_null"), prop.getProperty("key_word") + " ") + ";");
|
||||
|
||||
@@ -37,6 +37,9 @@ import com.nis.domain.configuration.template.DnsComplexStringTemplate;
|
||||
import com.nis.domain.configuration.template.DnsIpTemplate;
|
||||
import com.nis.domain.configuration.template.DnsResStrategyTemplate;
|
||||
import com.nis.domain.configuration.template.IpAllTemplate;
|
||||
import com.nis.domain.configuration.template.DomainInterceptMonitTemplate;
|
||||
import com.nis.domain.configuration.template.DomainInterceptRateLimitTemplate;
|
||||
import com.nis.domain.configuration.template.DomainInterceptTemplate;
|
||||
import com.nis.domain.configuration.template.IpPayloadTemplate;
|
||||
import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
||||
import com.nis.domain.configuration.template.IpWhitelistTemplate;
|
||||
@@ -360,6 +363,23 @@ public class IpController extends BaseController{
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, AppDomainTemplate.class, 2);
|
||||
excel.setDataList(this.getMsgProp(),classList,null).
|
||||
write(request,response, fileName).dispose();
|
||||
}else if(regionDict.getFunctionId().equals(201)){// Domain Intercept
|
||||
if(serviceDict.getAction().equals(1)){// 监测
|
||||
List<DomainInterceptMonitTemplate> classList=new ArrayList<DomainInterceptMonitTemplate>();
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, DomainInterceptMonitTemplate.class, 2);
|
||||
excel.setDataList(this.getMsgProp(),classList,null).
|
||||
write(request,response, fileName).dispose();
|
||||
}else if(serviceDict.getAction().equals(64)){// 限速
|
||||
List<DomainInterceptRateLimitTemplate> classList=new ArrayList<DomainInterceptRateLimitTemplate>();
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, DomainInterceptRateLimitTemplate.class, 2);
|
||||
excel.setDataList(this.getMsgProp(),classList,null).
|
||||
write(request,response, fileName).dispose();
|
||||
}else{// 白名单
|
||||
List<DomainInterceptTemplate> classList=new ArrayList<DomainInterceptTemplate>();
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, DomainInterceptTemplate.class, 2);
|
||||
excel.setDataList(this.getMsgProp(),classList,null).
|
||||
write(request,response, fileName).dispose();
|
||||
}
|
||||
}else{
|
||||
List<StringAllTemplate> classList=new ArrayList<StringAllTemplate>();
|
||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, StringAllTemplate.class, 2);
|
||||
|
||||
@@ -122,7 +122,7 @@ public class NtcCollectRadiusLogController extends BaseController {
|
||||
}else{
|
||||
hColumns+=",";
|
||||
}
|
||||
String cfgIndexInfoNoExport=","+hColumns;
|
||||
String cfgIndexInfoNoExport=",cfg_id,action,"+hColumns;
|
||||
noExportMap.put("radius_log",cfgIndexInfoNoExport);
|
||||
dataMap.put("radius_log",list);
|
||||
/*}*/
|
||||
|
||||
@@ -1671,6 +1671,10 @@ public abstract class BaseService {
|
||||
if(regionDict.getDictId().intValue()==64){
|
||||
// appCfgService.saveAppDomainCfg(listPage);
|
||||
this.saveStringCfgBatch(regionDict,serviceDict,listPage, AppDomainCfg.getTablename(),send);
|
||||
}else
|
||||
// 域名拦截
|
||||
if(regionDict.getDictId().intValue()==56){
|
||||
this.saveStringCfgBatch(regionDict,serviceDict,listPage, "http_url_cfg",send);
|
||||
}
|
||||
}else if("ComplexkeywordCfg".equals(type)) {
|
||||
List<ComplexkeywordCfg> listPage = (List<ComplexkeywordCfg>) list;
|
||||
|
||||
22
src/main/resources/sql/20181216/update_function_dict.sql
Normal file
22
src/main/resources/sql/20181216/update_function_dict.sql
Normal file
@@ -0,0 +1,22 @@
|
||||
-- IP拦截/域名拦截
|
||||
UPDATE
|
||||
function_region_dict
|
||||
SET
|
||||
config_protocol = '6,17',
|
||||
is_import = 1
|
||||
WHERE
|
||||
dict_id = 53 AND function_id = 200;
|
||||
|
||||
UPDATE
|
||||
function_region_dict
|
||||
SET
|
||||
is_import = 1
|
||||
WHERE
|
||||
function_id = 201;
|
||||
|
||||
UPDATE
|
||||
function_service_dict
|
||||
SET
|
||||
is_import = 1
|
||||
WHERE
|
||||
function_id = 200 OR function_id = 201;
|
||||
Reference in New Issue
Block a user