Merge branch 'develop' of https://git.mesalab.cn/K18_NTCS_WEB/NTC.git
into develop Conflicts: src/main/webapp/WEB-INF/views/dashboard/trafficBandwidthList.jsp
This commit is contained in:
@@ -0,0 +1,113 @@
|
|||||||
|
package com.nis.domain.configuration.template;
|
||||||
|
|
||||||
|
import com.nis.util.excel.ExcelField;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP Payload 导入模板类
|
||||||
|
* @author dell
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class AppPayloadTemplate extends ComplexStringAllTemplate{
|
||||||
|
|
||||||
|
// APP PAYLOAD L3_HEADER的特殊属性
|
||||||
|
private String ver;
|
||||||
|
private String ihl;
|
||||||
|
private String tos;
|
||||||
|
private String totalLength;
|
||||||
|
private String flags;
|
||||||
|
private String fragmentOffset;
|
||||||
|
private String protocol;
|
||||||
|
private String icmpType;
|
||||||
|
private String icmpCode;
|
||||||
|
private String icmpIdentifier;
|
||||||
|
private String headerType;
|
||||||
|
|
||||||
|
@ExcelField(title="headerType",align=2,sort=17)
|
||||||
|
public String getHeaderType() {
|
||||||
|
return headerType;
|
||||||
|
}
|
||||||
|
public void setHeaderType(String headerType) {
|
||||||
|
this.headerType = headerType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="VER",align=2,sort=18)
|
||||||
|
public String getVer() {
|
||||||
|
return ver;
|
||||||
|
}
|
||||||
|
public void setVer(String ver) {
|
||||||
|
this.ver = ver;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="IHL",align=2,sort=19)
|
||||||
|
public String getIhl() {
|
||||||
|
return ihl;
|
||||||
|
}
|
||||||
|
public void setIhl(String ihl) {
|
||||||
|
this.ihl = ihl;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="TOS",align=2,sort=20)
|
||||||
|
public String getTos() {
|
||||||
|
return tos;
|
||||||
|
}
|
||||||
|
public void setTos(String tos) {
|
||||||
|
this.tos = tos;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="Total Length",align=2,sort=21)
|
||||||
|
public String getTotalLength() {
|
||||||
|
return totalLength;
|
||||||
|
}
|
||||||
|
public void setTotalLength(String totalLength) {
|
||||||
|
this.totalLength = totalLength;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="Flags",align=2,sort=22)
|
||||||
|
public String getFlags() {
|
||||||
|
return flags;
|
||||||
|
}
|
||||||
|
public void setFlags(String flags) {
|
||||||
|
this.flags = flags;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="fragment offset",align=2,sort=23)
|
||||||
|
public String getFragmentOffset() {
|
||||||
|
return fragmentOffset;
|
||||||
|
}
|
||||||
|
public void setFragmentOffset(String fragmentOffset) {
|
||||||
|
this.fragmentOffset = fragmentOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="Protocol",align=2,sort=24)
|
||||||
|
public String getProtocol() {
|
||||||
|
return protocol;
|
||||||
|
}
|
||||||
|
public void setProtocol(String protocol) {
|
||||||
|
this.protocol = protocol;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="ICMP type",align=2,sort=25)
|
||||||
|
public String getIcmpType() {
|
||||||
|
return icmpType;
|
||||||
|
}
|
||||||
|
public void setIcmpType(String icmpType) {
|
||||||
|
this.icmpType = icmpType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="ICMP code",align=2,sort=26)
|
||||||
|
public String getIcmpCode() {
|
||||||
|
return icmpCode;
|
||||||
|
}
|
||||||
|
public void setIcmpCode(String icmpCode) {
|
||||||
|
this.icmpCode = icmpCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExcelField(title="ICMP identifier",align=2,sort=27)
|
||||||
|
public String getIcmpIdentifier() {
|
||||||
|
return icmpIdentifier;
|
||||||
|
}
|
||||||
|
public void setIcmpIdentifier(String icmpIdentifier) {
|
||||||
|
this.icmpIdentifier = icmpIdentifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
122
src/main/java/com/nis/domain/maat/ToUpdateMaatBeanStatus.java
Normal file
122
src/main/java/com/nis/domain/maat/ToUpdateMaatBeanStatus.java
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
/**
|
||||||
|
*@Title: ToMaatBean.java
|
||||||
|
*@Package com.nis.domain.configuration
|
||||||
|
*@Description TODO
|
||||||
|
*@author dell
|
||||||
|
*@date 2018年2月28日 下午2:03:08
|
||||||
|
*@version 版本号
|
||||||
|
*/
|
||||||
|
package com.nis.domain.maat;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.google.gson.annotations.Expose;
|
||||||
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改maat类配置状态
|
||||||
|
* @ClassName: ToUpdateStatusMaatBean.java
|
||||||
|
* @Description: TODO
|
||||||
|
* @author (dell)
|
||||||
|
* @date 2019年1月2日 下午3:08:08
|
||||||
|
* @version V1.0
|
||||||
|
*/
|
||||||
|
public class ToUpdateMaatBeanStatus implements Serializable{
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = -3468862666445104490L;
|
||||||
|
/**
|
||||||
|
* @Fields serialVersionUID:TODO(转换为maat格式的java bean)
|
||||||
|
*
|
||||||
|
* @since 1.0.0
|
||||||
|
*/
|
||||||
|
@Expose
|
||||||
|
private String version;
|
||||||
|
@Expose
|
||||||
|
@SerializedName("operator")
|
||||||
|
private String creatorName;
|
||||||
|
@Expose
|
||||||
|
@SerializedName("opTime")
|
||||||
|
private Date auditTime;
|
||||||
|
@Expose
|
||||||
|
private Integer opAction;
|
||||||
|
@Expose
|
||||||
|
private List<UpdateMaatCfgStatus> configCompileStartStopList;
|
||||||
|
|
||||||
|
public static class UpdateMaatCfgStatus{
|
||||||
|
@Expose
|
||||||
|
private Integer compileId;
|
||||||
|
@Expose
|
||||||
|
private Integer isValid;
|
||||||
|
@Expose
|
||||||
|
@SerializedName("opTime")
|
||||||
|
private Date auditTime;
|
||||||
|
public Integer getCompileId() {
|
||||||
|
return compileId;
|
||||||
|
}
|
||||||
|
public void setCompileId(Integer compileId) {
|
||||||
|
this.compileId = compileId;
|
||||||
|
}
|
||||||
|
public Integer getIsValid() {
|
||||||
|
return isValid;
|
||||||
|
}
|
||||||
|
public void setIsValid(Integer isValid) {
|
||||||
|
this.isValid = isValid;
|
||||||
|
}
|
||||||
|
public Date getAuditTime() {
|
||||||
|
return auditTime;
|
||||||
|
}
|
||||||
|
public void setAuditTime(Date auditTime) {
|
||||||
|
this.auditTime = auditTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
public String getVersion() {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setVersion(String version) {
|
||||||
|
this.version = version;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCreatorName() {
|
||||||
|
return creatorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreatorName(String creatorName) {
|
||||||
|
this.creatorName = creatorName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getAuditTime() {
|
||||||
|
return auditTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAuditTime(Date auditTime) {
|
||||||
|
this.auditTime = auditTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<UpdateMaatCfgStatus> getConfigCompileStartStopList() {
|
||||||
|
return configCompileStartStopList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setConfigCompileStartStopList(List<UpdateMaatCfgStatus> configCompileStartStopList) {
|
||||||
|
this.configCompileStartStopList = configCompileStartStopList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getOpAction() {
|
||||||
|
return opAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setOpAction(Integer opAction) {
|
||||||
|
this.opAction = opAction;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -814,6 +814,42 @@ public class ConfigServiceUtil {
|
|||||||
|
|
||||||
return bean;
|
return bean;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* maat配置停启用
|
||||||
|
* @param params
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String configStatusUpdate(String params) throws MaatConvertException{
|
||||||
|
String result = null;
|
||||||
|
ToMaatResult bean = null;
|
||||||
|
Response response=null;
|
||||||
|
try {
|
||||||
|
String url = Constants.SERVICE_URL+Constants.CONFIG_START_STOP_UPDATE;
|
||||||
|
//创建连接
|
||||||
|
WebTarget wt = ClientUtil.getWebTarger(url);
|
||||||
|
logger.info("put url:"+url);
|
||||||
|
//获取响应结果
|
||||||
|
Builder header = wt.request(MediaType.APPLICATION_JSON).header("Content-Type", MediaType.APPLICATION_JSON);
|
||||||
|
try {
|
||||||
|
response= header.put(Entity.entity(params, MediaType.APPLICATION_JSON));
|
||||||
|
if(response != null) {
|
||||||
|
result=response.readEntity(String.class);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
|
||||||
|
}
|
||||||
|
if(response !=null && response.getStatus() == 200){
|
||||||
|
JSONObject resObject = JSONObject.fromObject(result);
|
||||||
|
bean = (ToMaatResult) JSONObject.toBean(resObject,ToMaatResult.class);
|
||||||
|
}else{
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+result);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
try {
|
try {
|
||||||
// getId(1,1);
|
// getId(1,1);
|
||||||
|
|||||||
@@ -799,4 +799,7 @@ public final class Constants {
|
|||||||
public static final String NTC_EVENT_MONITOR_OR_BLOCK_Report =Configurations.getStringProperty("ntcEventsMonitorOrBlock","");
|
public static final String NTC_EVENT_MONITOR_OR_BLOCK_Report =Configurations.getStringProperty("ntcEventsMonitorOrBlock","");
|
||||||
|
|
||||||
public static final String NTC_EVENT_KEYPROTECTION_Report =Configurations.getStringProperty("ntcEventKeyProtection","");
|
public static final String NTC_EVENT_KEYPROTECTION_Report =Configurations.getStringProperty("ntcEventKeyProtection","");
|
||||||
|
|
||||||
|
//配置启停服务接口方法
|
||||||
|
public static final String CONFIG_START_STOP_UPDATE=Configurations.getStringProperty("configStartStop", "configStartStop");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +1,36 @@
|
|||||||
package com.nis.util;
|
package com.nis.util;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import com.nis.domain.configuration.AppPolicyCfg;
|
||||||
import com.nis.domain.configuration.AvFileSampleCfg;
|
import com.nis.domain.configuration.AvFileSampleCfg;
|
||||||
import com.nis.domain.configuration.AvSignSampleCfg;
|
import com.nis.domain.configuration.AvSignSampleCfg;
|
||||||
import com.nis.domain.configuration.BaseCfg;
|
import com.nis.domain.configuration.BaseCfg;
|
||||||
import com.nis.domain.configuration.CfgIndexInfo;
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
import com.nis.domain.configuration.DnsIpCfg;
|
import com.nis.domain.configuration.DnsIpCfg;
|
||||||
import com.nis.domain.configuration.DnsResStrategy;
|
import com.nis.domain.configuration.DnsResStrategy;
|
||||||
|
import com.nis.domain.configuration.FileDigestCfg;
|
||||||
import com.nis.domain.configuration.IpPortCfg;
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
import com.nis.domain.configuration.PxyObjKeyring;
|
import com.nis.domain.configuration.PxyObjKeyring;
|
||||||
import com.nis.domain.configuration.PxyObjTrustedCaCert;
|
import com.nis.domain.configuration.PxyObjTrustedCaCert;
|
||||||
import com.nis.domain.configuration.PxyObjTrustedCaCrl;
|
import com.nis.domain.configuration.PxyObjTrustedCaCrl;
|
||||||
|
import com.nis.domain.maat.MaatCfg;
|
||||||
|
import com.nis.domain.maat.ToMaatBean;
|
||||||
|
import com.nis.domain.maat.ToMaatResult;
|
||||||
|
import com.nis.domain.maat.ToUpdateMaatBeanStatus;
|
||||||
|
import com.nis.domain.maat.MaatCfg.DigestCfg;
|
||||||
|
import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||||
|
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||||
|
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||||
|
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||||
|
import com.nis.domain.maat.ToUpdateMaatBeanStatus.UpdateMaatCfgStatus;
|
||||||
import com.nis.web.dao.configuration.ConfigSynchronizationDao;
|
import com.nis.web.dao.configuration.ConfigSynchronizationDao;
|
||||||
import com.nis.web.service.BaseService;
|
import com.nis.web.service.BaseService;
|
||||||
import com.nis.web.service.SpringContextHolder;
|
import com.nis.web.service.SpringContextHolder;
|
||||||
@@ -29,6 +45,7 @@ public class SchedulerTaskUtil {
|
|||||||
|
|
||||||
//调度任务的配置信息,复用配置同步DAO
|
//调度任务的配置信息,复用配置同步DAO
|
||||||
private static ConfigSynchronizationDao configSynchronizationDao = SpringContextHolder.getBean(ConfigSynchronizationDao.class);
|
private static ConfigSynchronizationDao configSynchronizationDao = SpringContextHolder.getBean(ConfigSynchronizationDao.class);
|
||||||
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据业务与编译ID查询配置,修改失效或生效状态,并下发至综合服务
|
* 根据业务与编译ID查询配置,修改失效或生效状态,并下发至综合服务
|
||||||
@@ -49,48 +66,186 @@ public class SchedulerTaskUtil {
|
|||||||
String className = service.get("className").toString();
|
String className = service.get("className").toString();
|
||||||
BaseCfg entity = new BaseCfg();
|
BaseCfg entity = new BaseCfg();
|
||||||
entity.setServiceId(serviceId);
|
entity.setServiceId(serviceId);
|
||||||
entity.setCompileId(compileId);
|
|
||||||
entity.setTableName(tableName);
|
entity.setTableName(tableName);
|
||||||
List list = Lists.newArrayList();
|
List list = Lists.newArrayList();
|
||||||
|
List callBackCfgList = Lists.newArrayList();
|
||||||
|
boolean isUpdateContent = false;
|
||||||
|
/**
|
||||||
|
* 根据编译ID查询配置,如果配置当前审核状态为未审核(is_audit=0),并且newIsValid=1需要查询详细的域配置信息,下发配置详细内容,
|
||||||
|
* 如果已审核(is_audit=1),则只查询配置主表,更新配置状态即可,
|
||||||
|
* 如果审核取消(is_audit=3)则删除定时任务,表示配置已最终删除,此状态处理原则上在配置修改拦截器中处理
|
||||||
|
*/
|
||||||
if("1".equals(serviceType)){//maat类配置
|
if("1".equals(serviceType)){//maat类配置
|
||||||
|
Date updateTime = new Date();
|
||||||
|
//下发并修改配置状态的参数类
|
||||||
|
ToUpdateMaatBeanStatus maatStatusBean = new ToUpdateMaatBeanStatus();
|
||||||
|
UpdateMaatCfgStatus updateCfg = new UpdateMaatCfgStatus();
|
||||||
|
List<UpdateMaatCfgStatus> configCompileStartStopList = new ArrayList();
|
||||||
|
maatStatusBean.setVersion(Constants.MAAT_VERSION);
|
||||||
|
maatStatusBean.setOpAction(Constants.INSERT_ACTION);
|
||||||
|
maatStatusBean.setAuditTime(updateTime);
|
||||||
|
maatStatusBean.setCreatorName("TaskScheduler");//任务调度定时修改状态
|
||||||
|
|
||||||
|
//下发带有配置内容的参数对象
|
||||||
|
ToMaatBean maatBean = new ToMaatBean();
|
||||||
|
MaatCfg maatCfg = new MaatCfg();
|
||||||
|
List<MaatCfg> configCompileList = new ArrayList();
|
||||||
|
List<GroupCfg> groupRelationList = new ArrayList();
|
||||||
|
List<IpCfg> ipRegionList = new ArrayList();
|
||||||
|
List<StringCfg> strRegionList = new ArrayList();
|
||||||
|
List<NumBoundaryCfg> numRegionList = new ArrayList();
|
||||||
|
List<DigestCfg> digestRegionList = new ArrayList();
|
||||||
|
List<IpCfg> areaIpRegionList = new ArrayList();
|
||||||
|
|
||||||
|
// for(Integer compileId:compileIds){
|
||||||
|
entity.setCompileId(compileId);
|
||||||
//查询配置
|
//查询配置
|
||||||
if("cfg_index_info".equals(tableName)){
|
if("cfg_index_info".equals(tableName)){
|
||||||
list = configSynchronizationDao.getCfgIndexList(entity);
|
list = configSynchronizationDao.getCfgIndexList(entity);
|
||||||
|
List<Map<String,Object>> cfgList = (List<Map<String, Object>>) service.get("cfgList");
|
||||||
|
for(int i=0;i<list.size();i++){
|
||||||
|
CfgIndexInfo cfg = (CfgIndexInfo) list.get(i);
|
||||||
|
if(cfg.getIsAudit()==0){
|
||||||
|
isUpdateContent = true;
|
||||||
|
if(newIsValid==1){
|
||||||
|
//需要查询详细的域配置信息,下发配置内容,并修改数据库is_valid=1,is_audit=1
|
||||||
|
|
||||||
|
}else{
|
||||||
|
logger.debug("配置修改状态与当前配置状态不符合业务逻辑!");
|
||||||
|
}
|
||||||
|
}else{//修改各个配置域的配置状态
|
||||||
|
BaseCfg config = new BaseCfg();
|
||||||
|
config.setIsValid(newIsValid);
|
||||||
|
config.setEditTime(updateTime);
|
||||||
|
config.setCompileId(cfg.getCompileId());
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
if(cfgList!=null){
|
||||||
|
for(Map<String,Object> m:cfgList){
|
||||||
|
String regionTableName = m.get("tableName").toString();
|
||||||
|
config.setTableName(regionTableName);
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}else if("file_digest_cfg".equals(tableName)){
|
}else if("file_digest_cfg".equals(tableName)){
|
||||||
list = configSynchronizationDao.getFileDigestListByService(entity);
|
list = configSynchronizationDao.getFileDigestListByService(entity);
|
||||||
|
List<Map<String,Object>> cfgList = (List<Map<String, Object>>) service.get("cfgList");
|
||||||
|
for(int i=0;i<list.size();i++){
|
||||||
|
FileDigestCfg cfg = (FileDigestCfg) list.get(i);
|
||||||
|
if(cfg.getIsAudit()==0){
|
||||||
|
isUpdateContent = true;
|
||||||
|
if(newIsValid==1){
|
||||||
|
//需要查询详细的域配置信息,下发配置内容,并修改数据库is_valid=1,is_audit=1
|
||||||
|
|
||||||
|
}else{
|
||||||
|
logger.debug("配置修改状态与当前配置状态不符合业务逻辑!");
|
||||||
|
}
|
||||||
|
}else{//修改各个配置域的配置状态
|
||||||
|
BaseCfg config = new BaseCfg();
|
||||||
|
config.setIsValid(newIsValid);
|
||||||
|
config.setEditTime(updateTime);
|
||||||
|
config.setCompileId(cfg.getCompileId());
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
if(cfgList!=null){
|
||||||
|
for(Map<String,Object> m:cfgList){
|
||||||
|
String regionTableName = m.get("tableName").toString();
|
||||||
|
config.setTableName(regionTableName);
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}else if("app_policy_cfg".equals(tableName)){
|
}else if("app_policy_cfg".equals(tableName)){
|
||||||
list = configSynchronizationDao.getAppPolicyList(entity);
|
list = configSynchronizationDao.getAppPolicyList(entity);
|
||||||
|
List<Map<String,Object>> cfgList = (List<Map<String, Object>>) service.get("cfgList");
|
||||||
|
for(int i=0;i<list.size();i++){
|
||||||
|
AppPolicyCfg cfg = (AppPolicyCfg) list.get(i);
|
||||||
|
if(cfg.getIsAudit()==0){
|
||||||
|
isUpdateContent = true;
|
||||||
|
if(newIsValid==1){
|
||||||
|
//需要查询详细的域配置信息,下发配置内容,并修改数据库is_valid=1,is_audit=1
|
||||||
|
|
||||||
}else if("app_feature_index".equals(tableName)){
|
}else{
|
||||||
list = configSynchronizationDao.getAppFeatureIndexList(entity);
|
logger.debug("配置修改状态与当前配置状态不符合业务逻辑!");
|
||||||
|
}
|
||||||
|
}else{//修改各个配置域的配置状态
|
||||||
|
BaseCfg config = new BaseCfg();
|
||||||
|
config.setIsValid(newIsValid);
|
||||||
|
config.setEditTime(updateTime);
|
||||||
|
config.setCompileId(cfg.getCompileId());
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
if(cfgList!=null){
|
||||||
|
for(Map<String,Object> m:cfgList){
|
||||||
|
String regionTableName = m.get("tableName").toString();
|
||||||
|
config.setTableName(regionTableName);
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if(newIsValid.equals(1)){//生效
|
}
|
||||||
//调用综合服务配置生效启用接口
|
|
||||||
|
|
||||||
}else if(newIsValid.equals(0)){//失效
|
|
||||||
//调用综合服务配置失效停用接口
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
if(!isUpdateContent){
|
||||||
|
updateCfg.setIsValid(newIsValid);
|
||||||
|
updateCfg.setCompileId(compileId);
|
||||||
|
updateCfg.setAuditTime(updateTime);
|
||||||
|
configCompileStartStopList.add(updateCfg);
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
if(isUpdateContent){//修改配置内容以及状态
|
||||||
|
//下发配置内容
|
||||||
|
|
||||||
|
}else{//只修改配置状态
|
||||||
|
maatStatusBean.setConfigCompileStartStopList(configCompileStartStopList);
|
||||||
|
String json=BaseService.gsonToJson(maatBean);
|
||||||
|
//调用服务启停接口
|
||||||
|
String result = ConfigServiceUtil.configStatusUpdate(json);
|
||||||
|
logger.debug("MAAT类配置启停状态修改结果:"+result);
|
||||||
|
}
|
||||||
|
|
||||||
}else if("2".equals(serviceType)){//回调类配置
|
}else if("2".equals(serviceType)){//回调类配置
|
||||||
List newList = Lists.newArrayList();
|
|
||||||
List ids = Lists.newArrayList();
|
List ids = Lists.newArrayList();
|
||||||
|
// for(Integer compileId:compileIds){
|
||||||
|
entity.setCompileId(compileId);
|
||||||
//查询配置
|
//查询配置
|
||||||
if(entity.getServiceId().equals(3)){//ip drop回调类配置用了主表和子表关系
|
if(entity.getServiceId().equals(3)){//ip drop回调类配置用了主表和子表关系
|
||||||
list = configSynchronizationDao.getCfgIndexList(entity);
|
list = configSynchronizationDao.getCfgIndexList(entity);
|
||||||
if(!StringUtil.isEmpty(list)){
|
if(!StringUtil.isEmpty(list)){
|
||||||
List<Integer> compileIds = Lists.newArrayList();
|
List<Integer> compileIdArray = Lists.newArrayList();
|
||||||
for(int i=0;i<list.size();i++){
|
for(int i=0;i<list.size();i++){
|
||||||
CfgIndexInfo cfg = (CfgIndexInfo) list.get(i);
|
CfgIndexInfo cfg = (CfgIndexInfo) list.get(i);
|
||||||
compileIds.add(cfg.getCompileId());
|
if(cfg.getIsAudit()==0){
|
||||||
|
isUpdateContent = true;
|
||||||
|
Date updateTime = new Date();
|
||||||
|
cfg.setIsAudit(1);
|
||||||
|
cfg.setAuditTime(updateTime);
|
||||||
|
cfg.setTableName(tableName);
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
}
|
}
|
||||||
List subList = configSynchronizationDao.getIpDropList("ip_port_cfg", compileIds);
|
compileIdArray.add(cfg.getCompileId());
|
||||||
|
}
|
||||||
|
List subList = configSynchronizationDao.getIpDropList("ip_port_cfg", compileIdArray);
|
||||||
for(int i=0;i<subList.size();i++){
|
for(int i=0;i<subList.size();i++){
|
||||||
IpPortCfg cfg = (IpPortCfg) subList.get(i);
|
IpPortCfg cfg = (IpPortCfg) subList.get(i);
|
||||||
|
if(cfg.getIsAudit()==0){
|
||||||
|
isUpdateContent = true;
|
||||||
cfg.setIsValid(newIsValid);
|
cfg.setIsValid(newIsValid);
|
||||||
newList.add(BaseService.convertCallBackIp(cfg,cfg.getGroupId()));
|
if(newIsValid==1){
|
||||||
|
Date updateTime = new Date();
|
||||||
|
cfg.setIsAudit(1);
|
||||||
|
cfg.setAuditTime(updateTime);
|
||||||
|
cfg.setTableName("ip_port_cfg");
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
callBackCfgList.add(BaseService.convertCallBackIp(cfg,cfg.getGroupId()));
|
||||||
|
}else{
|
||||||
|
logger.debug("配置修改与配置当前状态不符合业务逻辑");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,91 +254,92 @@ public class SchedulerTaskUtil {
|
|||||||
list = configSynchronizationDao.getAvFileCfgList(entity);
|
list = configSynchronizationDao.getAvFileCfgList(entity);
|
||||||
for(int i=0;i<list.size();i++){
|
for(int i=0;i<list.size();i++){
|
||||||
AvFileSampleCfg cfg = (AvFileSampleCfg) list.get(i);
|
AvFileSampleCfg cfg = (AvFileSampleCfg) list.get(i);
|
||||||
|
if(cfg.getIsAudit()==0){
|
||||||
|
isUpdateContent = true;
|
||||||
cfg.setIsValid(newIsValid);
|
cfg.setIsValid(newIsValid);
|
||||||
newList.add(cfg);
|
if(newIsValid==1){
|
||||||
|
Date updateTime = new Date();
|
||||||
|
cfg.setIsAudit(1);
|
||||||
|
cfg.setAuditTime(updateTime);
|
||||||
|
cfg.setTableName(tableName);
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
callBackCfgList.add(cfg);
|
||||||
|
}else{
|
||||||
|
logger.debug("配置修改与配置当前状态不符合业务逻辑");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if(className.equals("AvSignSampleCfg")){//音视频场景配置
|
}else if(className.equals("AvSignSampleCfg")){//音视频场景配置
|
||||||
list = configSynchronizationDao.getAvSignCfgList(entity);
|
list = configSynchronizationDao.getAvSignCfgList(entity);
|
||||||
for(int i=0;i<list.size();i++){
|
for(int i=0;i<list.size();i++){
|
||||||
AvSignSampleCfg cfg = (AvSignSampleCfg) list.get(i);
|
AvSignSampleCfg cfg = (AvSignSampleCfg) list.get(i);
|
||||||
|
if(cfg.getIsAudit()==0){
|
||||||
|
isUpdateContent = true;
|
||||||
cfg.setIsValid(newIsValid);
|
cfg.setIsValid(newIsValid);
|
||||||
newList.add(cfg);
|
if(newIsValid==1){
|
||||||
}
|
Date updateTime = new Date();
|
||||||
}else if(className.equals("PxyObjKeyring")){
|
cfg.setIsAudit(1);
|
||||||
list = configSynchronizationDao.getPxyObjKeyringCfgList(entity);
|
cfg.setAuditTime(updateTime);
|
||||||
for(int i=0;i<list.size();i++){
|
cfg.setTableName(tableName);
|
||||||
PxyObjKeyring cfg = (PxyObjKeyring) list.get(i);
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
cfg.setIsValid(newIsValid);
|
callBackCfgList.add(cfg);
|
||||||
newList.add(BaseService.convertCallBackProxyObjKeyring(cfg));
|
}else{
|
||||||
}
|
logger.debug("配置修改与配置当前状态不符合业务逻辑");
|
||||||
}else if(className.equals("PxyObjTrustedCaCert")){
|
|
||||||
//下发cert配置时,需绑定下发crl配置
|
|
||||||
list = configSynchronizationDao.getPxyObjTrustedCertCfgList(entity);
|
|
||||||
for(int i=0;i<list.size();i++){
|
|
||||||
PxyObjTrustedCaCert cfg = (PxyObjTrustedCaCert) list.get(i);
|
|
||||||
cfg.setIsValid(newIsValid);
|
|
||||||
newList.addAll(BaseService.convertCallBackProxyObjTrustedCa(cfg,null));
|
|
||||||
ids.add(cfg.getCompileId());
|
|
||||||
}
|
|
||||||
if(!StringUtil.isEmpty(ids)){
|
|
||||||
list=new ArrayList<>();
|
|
||||||
list=configSynchronizationDao.getPxyObjTrustedCrlCfgListByCertId(ids);
|
|
||||||
for(int i=0;i<list.size();i++){
|
|
||||||
PxyObjTrustedCaCrl cfg = (PxyObjTrustedCaCrl) list.get(i);
|
|
||||||
cfg.setIsValid(newIsValid);
|
|
||||||
newList.addAll(BaseService.convertCallBackProxyObjTrustedCa(null,cfg));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if(className.equals("PxyObjTrustedCaCrl")){
|
|
||||||
ids=new ArrayList<>();
|
|
||||||
//只允许单独下发certId为空或0的crl配置
|
|
||||||
list = configSynchronizationDao.getPxyObjTrustedCrlCfgList(entity);
|
|
||||||
for(int i=0;i<list.size();i++){
|
|
||||||
PxyObjTrustedCaCrl cfg = (PxyObjTrustedCaCrl) list.get(i);
|
|
||||||
cfg.setIsValid(newIsValid);
|
|
||||||
newList.addAll(BaseService.convertCallBackProxyObjTrustedCa(null,cfg));
|
|
||||||
}
|
|
||||||
|
|
||||||
}else if(className.equals("DnsResStrategy")){
|
|
||||||
list = configSynchronizationDao.getDnsStrategyList(entity);
|
|
||||||
for(int i=0;i<list.size();i++){
|
|
||||||
DnsResStrategy cfg = (DnsResStrategy) list.get(i);
|
|
||||||
cfg.setIsValid(newIsValid);
|
|
||||||
newList.add(BaseService.convertCallBackDnsResStrategy(cfg));
|
|
||||||
}
|
|
||||||
}else if(className.equals("DnsIpCfg")){
|
|
||||||
list = configSynchronizationDao.getDnsIpCfgList(entity);
|
|
||||||
for(int i=0;i<list.size();i++){
|
|
||||||
DnsIpCfg cfg = (DnsIpCfg) list.get(i);
|
|
||||||
cfg.setIsValid(newIsValid);
|
|
||||||
newList.add(BaseService.convertCallBackIp(cfg,cfg.getDnsStrategyId()));
|
|
||||||
}
|
}
|
||||||
}else if(className.equals("IpPortCfg")){
|
}else if(className.equals("IpPortCfg")){
|
||||||
list = configSynchronizationDao.getIpPortListByService(entity);
|
list = configSynchronizationDao.getIpPortListByService(entity);
|
||||||
for(int i=0;i<list.size();i++){
|
for(int i=0;i<list.size();i++){
|
||||||
IpPortCfg cfg = (IpPortCfg) list.get(i);
|
IpPortCfg cfg = (IpPortCfg) list.get(i);
|
||||||
|
if(cfg.getIsAudit()==0){
|
||||||
|
isUpdateContent = true;
|
||||||
cfg.setIsValid(newIsValid);
|
cfg.setIsValid(newIsValid);
|
||||||
newList.add(BaseService.convertCallBackIp(cfg,cfg.getGroupId()));
|
if(newIsValid==1){
|
||||||
|
Date updateTime = new Date();
|
||||||
|
cfg.setIsAudit(1);
|
||||||
|
cfg.setAuditTime(updateTime);
|
||||||
|
cfg.setTableName(tableName);
|
||||||
|
configSynchronizationDao.updateCfgStatus(cfg);//修改界面数据库配置状态
|
||||||
|
callBackCfgList.add(BaseService.convertCallBackIp(cfg,cfg.getGroupId()));
|
||||||
|
}else{
|
||||||
|
logger.debug("配置修改与配置当前状态不符合业务逻辑");
|
||||||
}
|
}
|
||||||
}else if(className.equals("PxyObjSpoofingIpPool")){
|
|
||||||
list = configSynchronizationDao.getSpoofingIpPoolList(entity);
|
|
||||||
newList.addAll(list);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!isUpdateContent){//如果没有内容修改,则只更新状态
|
||||||
|
Date updateTime = new Date();
|
||||||
|
BaseCfg updateCfg = new BaseCfg();
|
||||||
|
updateCfg.setIsValid(newIsValid);
|
||||||
|
updateCfg.setCompileId(compileId);
|
||||||
|
updateCfg.setServiceId(serviceId);
|
||||||
|
updateCfg.setAuditTime(updateTime);
|
||||||
|
updateCfg.setEditTime(updateTime);
|
||||||
|
updateCfg.setCreatorName("TaskScheduler");
|
||||||
|
configSynchronizationDao.updateCfgStatus(updateCfg);//修改界面数据库配置状态
|
||||||
|
callBackCfgList.add(updateCfg);
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
if(!StringUtil.isEmpty(callBackCfgList)){
|
||||||
//调用服务接口下发配置数据
|
//调用服务接口下发配置数据
|
||||||
String json=BaseService.gsonToJson(newList);
|
String json=BaseService.gsonToJson(callBackCfgList);
|
||||||
if(newIsValid.equals(1)){//生效
|
//调用服务接口修改回调类配置状态
|
||||||
//调用综合服务配置生效启用接口
|
ToMaatResult result = ConfigServiceUtil.put(json,2);
|
||||||
|
logger.debug("回调类配置启停状态修改结果:"+result);
|
||||||
}else if(newIsValid.equals(0)){//失效
|
|
||||||
//调用综合服务配置失效停用接口
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1036,6 +1036,11 @@ public class ExportExcel {
|
|||||||
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+defaultValue+"\n";
|
||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
|
// APP Payload
|
||||||
|
if(region.getFunctionId().equals(563)) {
|
||||||
|
commentStr=commentStr+"▶"+"L3_header:"+msgProp.getProperty("need_input")+"'headerType'"+"\n";
|
||||||
|
index++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1257,6 +1262,95 @@ public class ExportExcel {
|
|||||||
index++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// APP Payload
|
||||||
|
if("headerType".equals(headerStr)){
|
||||||
|
commentStr=commentStr+"IP_header"+"\n"+"ICMP_header"+"\n";
|
||||||
|
index++;
|
||||||
|
index++;
|
||||||
|
defaultValue=region.getConfigDistrict().split(",")[0];
|
||||||
|
|
||||||
|
commentStr=msgProp.getProperty("select")+":\n"+commentStr;
|
||||||
|
index++;
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
|
||||||
|
//1、非空说明
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("required")+"\n";
|
||||||
|
index++;
|
||||||
|
//2、默认值说明
|
||||||
|
/*if(!StringUtil.isEmpty(defaultValue)){
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("default_value")+":"+"IP_header"+"\n";
|
||||||
|
index++;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
commentStr=commentStr+"▶"+"IP_header:"+msgProp.getProperty("need_input")+"('VER'、'IHL'、'TOS'、'Total Length'、'Flags'、'fragment offset'、'Protocol'),"+msgProp.getProperty("max_input")+"\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+"ICMP_header:"+msgProp.getProperty("need_input")+"('ICMP type'、'ICMP code'、'ICMP identifier')"+"\n";
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("VER".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_4");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("IHL".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_4");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("TOS".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_8");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("Total Length".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_16");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("Flags".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_3");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("fragment offset".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_8");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("Protocol".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_8");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("ICMP type".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_8");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("ICMP code".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_8");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
if("ICMP identifier".equals(headerStr)){
|
||||||
|
commentStr=commentStr+msgProp.getProperty("rule_desc_tip")+":\n";
|
||||||
|
index++;
|
||||||
|
commentStr=commentStr+"▶"+msgProp.getProperty("hex_minlength_16");
|
||||||
|
index++;
|
||||||
|
}
|
||||||
|
|
||||||
}else if(region.getRegionType().equals(6)) {
|
}else if(region.getRegionType().equals(6)) {
|
||||||
if(region.getFunctionId().equals(400)) {
|
if(region.getFunctionId().equals(400)) {
|
||||||
if("group".equals(headerStr)){
|
if("group".equals(headerStr)){
|
||||||
|
|||||||
@@ -0,0 +1,352 @@
|
|||||||
|
package com.nis.util.excel.thread;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.concurrent.BlockingQueue;
|
||||||
|
import java.util.concurrent.Callable;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
import org.jets3t.service.ServiceException;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
|
||||||
|
import com.beust.jcommander.internal.Lists;
|
||||||
|
import com.beust.jcommander.internal.Sets;
|
||||||
|
import com.nis.domain.FunctionRegionDict;
|
||||||
|
import com.nis.domain.FunctionServiceDict;
|
||||||
|
import com.nis.domain.configuration.AppComplexFeatureCfg;
|
||||||
|
import com.nis.util.Constants;
|
||||||
|
import com.nis.web.service.SpringContextHolder;
|
||||||
|
import com.nis.web.service.configuration.AppMultiFeatureCfgService;
|
||||||
|
|
||||||
|
public class CheckAppFeatureComplexStringFormatThread implements Callable<String>{
|
||||||
|
private Logger logger=Logger.getLogger(CheckAppFeatureComplexStringFormatThread.class);
|
||||||
|
private BlockingQueue<? extends Object> srcQueue;
|
||||||
|
private BlockingQueue<AppComplexFeatureCfg> destQueue;
|
||||||
|
private Properties prop;
|
||||||
|
private FunctionServiceDict serviceDict;
|
||||||
|
private FunctionRegionDict regionDict;
|
||||||
|
|
||||||
|
public CheckAppFeatureComplexStringFormatThread(FunctionServiceDict serviceDict,FunctionRegionDict regionDict,Properties prop,BlockingQueue<? extends Object> srcQueue,BlockingQueue<AppComplexFeatureCfg> destQueue) {
|
||||||
|
this.serviceDict=serviceDict;
|
||||||
|
this.regionDict=regionDict;
|
||||||
|
this.srcQueue=srcQueue;
|
||||||
|
this.destQueue=destQueue;
|
||||||
|
this.prop=prop;
|
||||||
|
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String call() throws Exception {
|
||||||
|
List<Object> dataList=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
StringBuffer msg=new StringBuffer();
|
||||||
|
while(!srcQueue.isEmpty()) {
|
||||||
|
int size=srcQueue.drainTo(dataList,Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
if(regionDict.getRegionType().intValue()==3) {
|
||||||
|
try {
|
||||||
|
List<AppComplexFeatureCfg> cfgs=this.checkAppComplexFeatureCfg(msg,dataList);
|
||||||
|
destQueue.addAll(cfgs);
|
||||||
|
}catch (Exception e) {
|
||||||
|
logger.error("checkComplexStringCfg error,",e);
|
||||||
|
// TODO: handle exception
|
||||||
|
//msg=e.getMessage();
|
||||||
|
//msg.append(e.getMessage());
|
||||||
|
//break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dataList.clear();
|
||||||
|
}
|
||||||
|
return msg.toString();
|
||||||
|
}
|
||||||
|
public List<AppComplexFeatureCfg> checkAppComplexFeatureCfg(StringBuffer msg,
|
||||||
|
List<?> list) throws ServiceException {
|
||||||
|
logger.warn("start to validate appfeaturecomplexString data...");
|
||||||
|
long start=System.currentTimeMillis();
|
||||||
|
List<AppComplexFeatureCfg> stringList = new ArrayList<AppComplexFeatureCfg>();
|
||||||
|
String exprTypeP = regionDict.getConfigExprType();
|
||||||
|
if (StringUtils.isBlank(exprTypeP)) {
|
||||||
|
throw new RuntimeException("Found String region,but exprType is Empty");
|
||||||
|
}
|
||||||
|
String matchMethodP = regionDict.getConfigMatchMethod();
|
||||||
|
if (StringUtils.isBlank(matchMethodP)) {
|
||||||
|
throw new RuntimeException("Found String region,but matchMethod is Empty");
|
||||||
|
}
|
||||||
|
String hexP = regionDict.getConfigHex();
|
||||||
|
if (StringUtils.isBlank(hexP)) {
|
||||||
|
throw new RuntimeException("Found String region,but hex is Empty");
|
||||||
|
}
|
||||||
|
String mulityKeywordsP = regionDict.getConfigMultiKeywords();
|
||||||
|
if (StringUtils.isBlank(mulityKeywordsP)) {
|
||||||
|
throw new RuntimeException("Found String region,but mulityKeywords is Empty");
|
||||||
|
}
|
||||||
|
String dirtrictP = regionDict.getConfigDistrict();
|
||||||
|
StringBuffer errTip = new StringBuffer();
|
||||||
|
Pattern pattern = Pattern.compile("\t|\r|\n|\b|\f");
|
||||||
|
AppMultiFeatureCfgService appMultiFeatureCfgService = SpringContextHolder.getBean(AppMultiFeatureCfgService.class);
|
||||||
|
for (int i = 0; i < list.size(); i++) {
|
||||||
|
StringBuffer errInfo = new StringBuffer();
|
||||||
|
AppComplexFeatureCfg baseStringCfg = new AppComplexFeatureCfg();
|
||||||
|
BeanUtils.copyProperties(list.get(i), baseStringCfg);
|
||||||
|
// 配置描述、关键字长度限制
|
||||||
|
if(baseStringCfg.getCfgDesc().length() > 128) {
|
||||||
|
errInfo.append(prop.getProperty("config_describe")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("max_length")+":128") + ";");
|
||||||
|
}
|
||||||
|
if(baseStringCfg.getCfgKeywords().length() < 4 || baseStringCfg.getCfgKeywords().length() > 1024){
|
||||||
|
errInfo.append(prop.getProperty("key_word")+prop.getProperty("length_error")+" "+String.format(prop.getProperty("min_length")+":4,"+prop.getProperty("max_length")+":1024") + ";");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (regionDict.getRegionType().equals(3)) {
|
||||||
|
String keyword = baseStringCfg.getCfgKeywords();
|
||||||
|
String district = baseStringCfg.getDistrict();
|
||||||
|
if (StringUtils.isBlank(keyword)) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), prop.getProperty("key_word") + " ") + ";");
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(dirtrictP)) {
|
||||||
|
if (StringUtils.isBlank(district)) {
|
||||||
|
if (dirtrictP.indexOf(",") == -1) {
|
||||||
|
baseStringCfg.setDistrict(dirtrictP);
|
||||||
|
} else {
|
||||||
|
// baseStringCfg.setDistrict(dirtrictP.split(",")[0]);
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), prop.getProperty("district") + " ")
|
||||||
|
+ ";");
|
||||||
|
}
|
||||||
|
} else if (dirtrictP.indexOf(district) == -1) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("district") + " ")
|
||||||
|
+ ";");
|
||||||
|
} else if (dirtrictP.indexOf("others")>-1&&district.equals("others")) {
|
||||||
|
//不允许自定义匹配区域导入
|
||||||
|
errInfo.append(prop.getProperty("district")+" "+
|
||||||
|
String.format(prop.getProperty("can_not_be"), " 'others'")+ ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (mulityKeywordsP.equals("0")) {
|
||||||
|
if (keyword.indexOf("\n") > -1) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("not_multiple"), prop.getProperty("key_word")) + ";");
|
||||||
|
}
|
||||||
|
Matcher m = pattern.matcher(keyword);
|
||||||
|
if (m.find()) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("has_invisible_char"),
|
||||||
|
prop.getProperty("key_word") + " '" + keyword + "'") + ";");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
boolean has = false;
|
||||||
|
Set<String> keywordSet=Sets.newHashSet();
|
||||||
|
|
||||||
|
for (String key : keyword.split("\n")) {
|
||||||
|
Matcher m = pattern.matcher(key);
|
||||||
|
if (m.find()) {
|
||||||
|
has = true;
|
||||||
|
errInfo.append(String.format(prop.getProperty("has_invisible_char"),
|
||||||
|
prop.getProperty("key_word") + " '" + key + "'") + ";");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(!keywordSet.contains(key)) {
|
||||||
|
keywordSet.add(key);
|
||||||
|
}else {
|
||||||
|
errInfo.append(prop.getProperty("key_word") + " '" + key + "'"+" "+prop.getProperty("repeat") + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!has) {
|
||||||
|
if(keyword.replaceAll("\n","").length()>1024) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("most_keywords"),
|
||||||
|
prop.getProperty("key_word")) + ";");
|
||||||
|
}else {
|
||||||
|
String reWord = keyword.replaceAll("\n", Constants.KEYWORD_EXPR);
|
||||||
|
baseStringCfg.setCfgKeywords(reWord);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Integer exprType = baseStringCfg.getExprType();
|
||||||
|
boolean has = false;
|
||||||
|
if (exprType == null) {
|
||||||
|
if (exprTypeP.indexOf(",") == -1) {
|
||||||
|
if (mulityKeywordsP.equals("0") && exprTypeP.equals("1")) {
|
||||||
|
throw new RuntimeException("region dict config error,dict id is " + regionDict.getDictId());
|
||||||
|
}
|
||||||
|
baseStringCfg.setExprType(Integer.parseInt(exprTypeP));
|
||||||
|
} else if (exprTypeP.indexOf("0") > -1 && mulityKeywordsP.equals("0")) {
|
||||||
|
baseStringCfg.setExprType(0);
|
||||||
|
} else if (exprTypeP.indexOf("1") > -1 && mulityKeywordsP.equals("1")
|
||||||
|
&& keyword.indexOf("\n") > -1) {
|
||||||
|
baseStringCfg.setExprType(1);
|
||||||
|
} else if (exprTypeP.indexOf("0") > -1 && mulityKeywordsP.equals("1")
|
||||||
|
&& keyword.indexOf("\n") == -1) {
|
||||||
|
baseStringCfg.setExprType(0);
|
||||||
|
} else {
|
||||||
|
baseStringCfg.setExprType(Integer.parseInt(exprTypeP.split(",")[0]));
|
||||||
|
}
|
||||||
|
// errInfo.append(String.format(prop.getProperty("can_not_null"),
|
||||||
|
// prop.getProperty("expression_type"))+";");
|
||||||
|
} else {
|
||||||
|
for (String exp : exprTypeP.split(",")) {
|
||||||
|
if (exp.equals(exprType.toString())) {
|
||||||
|
has = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!has) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("expression_type"))
|
||||||
|
+ ";");
|
||||||
|
}
|
||||||
|
has = false;
|
||||||
|
}
|
||||||
|
exprType = baseStringCfg.getExprType();
|
||||||
|
Integer matchMethod = baseStringCfg.getMatchMethod();
|
||||||
|
if (matchMethod == null) {
|
||||||
|
if (matchMethodP.indexOf(",") == -1) {
|
||||||
|
if (exprTypeP.equals("1") && !matchMethodP.equals("0")) {
|
||||||
|
throw new RuntimeException("region dict config error,dict id is " + regionDict.getDictId());
|
||||||
|
}
|
||||||
|
baseStringCfg.setMatchMethod(Integer.parseInt(matchMethodP));
|
||||||
|
} else if (exprType != null && exprType.intValue() == 1) {
|
||||||
|
if (matchMethodP.indexOf("0") > -1) {
|
||||||
|
baseStringCfg.setMatchMethod(0);
|
||||||
|
} else {
|
||||||
|
throw new RuntimeException("region dict config error,dict id is " + regionDict.getDictId());
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
baseStringCfg.setMatchMethod(Integer.parseInt(matchMethodP.split(",")[0]));
|
||||||
|
}
|
||||||
|
// errInfo.append(String.format(prop.getProperty("can_not_null"),
|
||||||
|
// prop.getProperty("match_method"))+";");
|
||||||
|
} else {
|
||||||
|
for (String exp : matchMethodP.split(",")) {
|
||||||
|
if (exp.equals(matchMethod.toString())) {
|
||||||
|
has = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!has) {
|
||||||
|
errInfo.append(String.format(prop.getProperty("is_incorrect"), prop.getProperty("match_method"))
|
||||||
|
+ ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Integer isHex = baseStringCfg.getIsHex();
|
||||||
|
Integer isCaseInsenstive = baseStringCfg.getIsCaseInsenstive();
|
||||||
|
if (isHex == null || isCaseInsenstive == null) {
|
||||||
|
if (isHex == null) {
|
||||||
|
if (hexP.indexOf("0")>-1 || hexP.indexOf("2")>-1) {
|
||||||
|
baseStringCfg.setIsHex(0);
|
||||||
|
} else if (hexP.indexOf("1")>-1) {
|
||||||
|
baseStringCfg.setIsHex(1);
|
||||||
|
} else {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), prop.getProperty("is_hex")) + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (isCaseInsenstive == null) {
|
||||||
|
if (hexP.indexOf("0")>-1 || hexP.indexOf("1")>-1) {
|
||||||
|
baseStringCfg.setIsCaseInsenstive(0);
|
||||||
|
} else if (hexP.indexOf("2")>-1) {
|
||||||
|
baseStringCfg.setIsCaseInsenstive(1);
|
||||||
|
} else {
|
||||||
|
errInfo.append(String.format(prop.getProperty("can_not_null"),
|
||||||
|
prop.getProperty("is_case_insenstive")) + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (isHex.intValue() != 0 && isHex.intValue() != 1) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||||
|
}
|
||||||
|
if (isCaseInsenstive.intValue() != 0 && isCaseInsenstive.intValue() != 1) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||||
|
+ ";");
|
||||||
|
}
|
||||||
|
if (hexP.indexOf("1") == -1 && isHex.intValue() == 1) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||||
|
}
|
||||||
|
if (hexP.equals("1") && isHex.intValue() == 0) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_hex")) + ";");
|
||||||
|
}
|
||||||
|
if (hexP.indexOf("2") == -1 && isCaseInsenstive.intValue() == 1) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||||
|
+ ";");
|
||||||
|
}
|
||||||
|
if (hexP.equals("2") && isCaseInsenstive.intValue() == 0) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), prop.getProperty("is_case_insenstive"))
|
||||||
|
+ ";");
|
||||||
|
}
|
||||||
|
// 关键字十六进制校验
|
||||||
|
if (hexP.indexOf("1") != -1 && isHex.intValue() == 1) {
|
||||||
|
boolean bl = Pattern.compile("^([0-9|a-f|A-F]*)$").matcher(keyword).matches();
|
||||||
|
if(!bl) {
|
||||||
|
errInfo.append(
|
||||||
|
prop.getProperty("key_word") + " '" + keyword + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
isHex = baseStringCfg.getIsHex();
|
||||||
|
isCaseInsenstive = baseStringCfg.getIsCaseInsenstive();
|
||||||
|
if (isHex != null && isCaseInsenstive != null) {
|
||||||
|
if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 0) {
|
||||||
|
baseStringCfg.setIsHexbin(0);
|
||||||
|
} else if (isHex.intValue() == 1 && isCaseInsenstive.intValue() == 0) {
|
||||||
|
baseStringCfg.setIsHexbin(1);
|
||||||
|
} else if (isHex.intValue() == 0 && isCaseInsenstive.intValue() == 1) {
|
||||||
|
baseStringCfg.setIsHexbin(2);
|
||||||
|
} else if (hexP.indexOf("1") != -1 && isHex.intValue() == 1 && isCaseInsenstive.intValue() == 1) {// 只有是十六进制且取值正确的时候, 才进行(十六进制)与(大小写敏感)的校验
|
||||||
|
errInfo.append(prop.getProperty("hex_case_insensitive")+ ";");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// APP Payload L3_HEADER的特殊属性限制
|
||||||
|
if(baseStringCfg.getDistrict().equals("L3_header")) {
|
||||||
|
String headerType = baseStringCfg.getHeaderType();
|
||||||
|
if(StringUtils.isBlank(headerType)) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), "headerType") + ";");
|
||||||
|
}else if((!"IP_header".equals(headerType)) && (!"ICMP_header".equals(headerType))) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("is_incorrect"), "headerType") + ";");
|
||||||
|
}else{
|
||||||
|
appMultiFeatureCfgService.checkImportAppPayload(baseStringCfg, errInfo, prop);
|
||||||
|
}
|
||||||
|
appMultiFeatureCfgService.setL3HeaderKeyword(baseStringCfg);
|
||||||
|
}else {
|
||||||
|
baseStringCfg.setHeaderType(null);
|
||||||
|
baseStringCfg.setVer(null);
|
||||||
|
baseStringCfg.setIhl(null);
|
||||||
|
baseStringCfg.setTos(null);
|
||||||
|
baseStringCfg.setTotalLength(null);
|
||||||
|
baseStringCfg.setFlags(null);
|
||||||
|
baseStringCfg.setFragmentOffset(null);
|
||||||
|
baseStringCfg.setProtocol(null);
|
||||||
|
baseStringCfg.setIcmpType(null);
|
||||||
|
baseStringCfg.setIcmpCode(null);
|
||||||
|
baseStringCfg.setIcmpIdentifier(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (errInfo.toString().length() > 0) {
|
||||||
|
errTip.append(String.format(prop.getProperty("line"), baseStringCfg.getIndex()) + ",");
|
||||||
|
errTip.append(errInfo);
|
||||||
|
errTip.append("<br>");
|
||||||
|
}else {
|
||||||
|
stringList.add(baseStringCfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (errTip.toString().length() > 0) {
|
||||||
|
msg.append(errTip);
|
||||||
|
//throw new ServiceException(errTip.toString());
|
||||||
|
}
|
||||||
|
long end=System.currentTimeMillis();
|
||||||
|
logger.warn("validate appfeaturecomplexString data finish,cost:"+(end-start));
|
||||||
|
return stringList;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -47,6 +47,7 @@ import com.nis.domain.SysDataDictionaryItem;
|
|||||||
import com.nis.domain.basics.AsnIpCfg;
|
import com.nis.domain.basics.AsnIpCfg;
|
||||||
import com.nis.domain.basics.ServiceDictInfo;
|
import com.nis.domain.basics.ServiceDictInfo;
|
||||||
import com.nis.domain.basics.SysDictInfo;
|
import com.nis.domain.basics.SysDictInfo;
|
||||||
|
import com.nis.domain.configuration.AppComplexFeatureCfg;
|
||||||
import com.nis.domain.configuration.AppDomainCfg;
|
import com.nis.domain.configuration.AppDomainCfg;
|
||||||
import com.nis.domain.configuration.AppFeatureIndex;
|
import com.nis.domain.configuration.AppFeatureIndex;
|
||||||
import com.nis.domain.configuration.AppHttpCfg;
|
import com.nis.domain.configuration.AppHttpCfg;
|
||||||
@@ -75,6 +76,7 @@ import com.nis.domain.configuration.PxyObjTrustedCaCrl;
|
|||||||
import com.nis.domain.configuration.RequestInfo;
|
import com.nis.domain.configuration.RequestInfo;
|
||||||
import com.nis.domain.configuration.StringCfgTemplate;
|
import com.nis.domain.configuration.StringCfgTemplate;
|
||||||
import com.nis.domain.configuration.template.AppDomainTemplate;
|
import com.nis.domain.configuration.template.AppDomainTemplate;
|
||||||
|
import com.nis.domain.configuration.template.AppPayloadTemplate;
|
||||||
import com.nis.domain.configuration.template.AsnIpTemplate;
|
import com.nis.domain.configuration.template.AsnIpTemplate;
|
||||||
import com.nis.domain.configuration.template.ComplexStringAllTemplate;
|
import com.nis.domain.configuration.template.ComplexStringAllTemplate;
|
||||||
import com.nis.domain.configuration.template.DdosIpTemplate;
|
import com.nis.domain.configuration.template.DdosIpTemplate;
|
||||||
@@ -127,6 +129,7 @@ import com.nis.util.StringUtil;
|
|||||||
import com.nis.util.excel.ExcelCsv;
|
import com.nis.util.excel.ExcelCsv;
|
||||||
import com.nis.util.excel.ExportExcel;
|
import com.nis.util.excel.ExportExcel;
|
||||||
import com.nis.util.excel.ImportBigExcel;
|
import com.nis.util.excel.ImportBigExcel;
|
||||||
|
import com.nis.util.excel.thread.CheckAppFeatureComplexStringFormatThread;
|
||||||
import com.nis.util.excel.thread.CheckComplexStringFormatThread;
|
import com.nis.util.excel.thread.CheckComplexStringFormatThread;
|
||||||
import com.nis.util.excel.thread.CheckDnsResStrategyFormatThread;
|
import com.nis.util.excel.thread.CheckDnsResStrategyFormatThread;
|
||||||
import com.nis.util.excel.thread.CheckIpFormatThread;
|
import com.nis.util.excel.thread.CheckIpFormatThread;
|
||||||
@@ -1093,6 +1096,48 @@ public class BaseController {
|
|||||||
return queue;
|
return queue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多线程验证
|
||||||
|
* @param _msg
|
||||||
|
* @param serviceDict
|
||||||
|
* @param regionDict
|
||||||
|
* @param list
|
||||||
|
* @return
|
||||||
|
* @throws InterruptedException
|
||||||
|
* @throws ExecutionException
|
||||||
|
* @throws ServiceException
|
||||||
|
*/
|
||||||
|
public BlockingQueue<AppComplexFeatureCfg> checkAppComplexFeatureStringCfgMulity(StringBuffer _msg,FunctionServiceDict serviceDict, FunctionRegionDict regionDict,BlockingQueue<? extends Object> list) throws InterruptedException, ExecutionException, ServiceException{
|
||||||
|
logger.warn("start checkAppComplexFeatureStringCfgMulity ,size "+list.size());
|
||||||
|
long start=System.currentTimeMillis();
|
||||||
|
BlockingQueue<AppComplexFeatureCfg> queue=new ArrayBlockingQueue<>(list.size());
|
||||||
|
ExecutorService service=Executors.newFixedThreadPool(Constants.MULITY_THREAD_SIZE);
|
||||||
|
List<Future<String>> futures=new ArrayList<>();
|
||||||
|
for(int i=0;i<Constants.MULITY_THREAD_SIZE;i++) {
|
||||||
|
CheckAppFeatureComplexStringFormatThread t = new CheckAppFeatureComplexStringFormatThread(serviceDict,regionDict, this.getMsgProp(), list, queue);
|
||||||
|
futures.add(service.submit(t));
|
||||||
|
}
|
||||||
|
service.shutdown();
|
||||||
|
while(!service.isTerminated()) {
|
||||||
|
try {
|
||||||
|
Thread.sleep(10);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
// TODO Auto-generated catch block
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(Future<String> future:futures) {
|
||||||
|
String msg = future.get();
|
||||||
|
if(StringUtils.isNotBlank(msg)) {
|
||||||
|
_msg.append(msg);
|
||||||
|
//throw new ServiceException(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
long end=System.currentTimeMillis();
|
||||||
|
logger.warn("checkAppComplexFeatureStringCfgMulity finish,cost:"+(end-start)+",size:"+queue.size());
|
||||||
|
return queue;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* setReportSearchTime(报表查询设置开始时间与结束时间) (这里描述这个方法适用条件 – 可选)
|
* setReportSearchTime(报表查询设置开始时间与结束时间) (这里描述这个方法适用条件 – 可选)
|
||||||
@@ -1229,6 +1274,7 @@ public class BaseController {
|
|||||||
BlockingQueue<BaseStringCfg<?>> stringCfgs =null;
|
BlockingQueue<BaseStringCfg<?>> stringCfgs =null;
|
||||||
BlockingQueue<ComplexkeywordCfg> complexkeywordCfgs =null;
|
BlockingQueue<ComplexkeywordCfg> complexkeywordCfgs =null;
|
||||||
BlockingQueue<DnsResStrategy> dnsResStrategies=null;
|
BlockingQueue<DnsResStrategy> dnsResStrategies=null;
|
||||||
|
BlockingQueue<AppComplexFeatureCfg> appComplexFeatureCfgs=null;
|
||||||
List<CfgIndexInfo> cfgIndexInfos = new ArrayList<CfgIndexInfo>();
|
List<CfgIndexInfo> cfgIndexInfos = new ArrayList<CfgIndexInfo>();
|
||||||
List<AppPolicyCfg> appPolicyCfgs = new ArrayList<AppPolicyCfg>();
|
List<AppPolicyCfg> appPolicyCfgs = new ArrayList<AppPolicyCfg>();
|
||||||
List<AppFeatureIndex> appFeatureIndexs= new ArrayList<AppFeatureIndex>();
|
List<AppFeatureIndex> appFeatureIndexs= new ArrayList<AppFeatureIndex>();
|
||||||
@@ -1361,6 +1407,9 @@ public class BaseController {
|
|||||||
} else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
} else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
BlockingQueue<HttpsReplaceComplexTemplate> list = ei.getDataList(HttpsReplaceComplexTemplate.class);
|
BlockingQueue<HttpsReplaceComplexTemplate> list = ei.getDataList(HttpsReplaceComplexTemplate.class);
|
||||||
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
|
} else if(regionDict.getFunctionId().equals(563)){// APP Payload
|
||||||
|
BlockingQueue<AppPayloadTemplate> list = ei.getDataList(AppPayloadTemplate.class);
|
||||||
|
appComplexFeatureCfgs = this.checkAppComplexFeatureStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||||
} else {
|
} else {
|
||||||
BlockingQueue<ComplexStringAllTemplate> list = ei.getDataList(ComplexStringAllTemplate.class
|
BlockingQueue<ComplexStringAllTemplate> list = ei.getDataList(ComplexStringAllTemplate.class
|
||||||
);
|
);
|
||||||
@@ -1673,7 +1722,7 @@ public class BaseController {
|
|||||||
}
|
}
|
||||||
if(regionDict.getFunctionId().intValue()==565 || regionDict.getFunctionId().intValue()==566 || regionDict.getFunctionId().intValue()==563){
|
if(regionDict.getFunctionId().intValue()==565 || regionDict.getFunctionId().intValue()==566 || regionDict.getFunctionId().intValue()==563){
|
||||||
AppFeatureIndex appfeature = new AppFeatureIndex();
|
AppFeatureIndex appfeature = new AppFeatureIndex();
|
||||||
if(appFeatureRegion!=null){
|
if(regionDict!=null){
|
||||||
appfeature.setCfgRegionCode1(String.valueOf(regionDict.getConfigRegionCode()));
|
appfeature.setCfgRegionCode1(String.valueOf(regionDict.getConfigRegionCode()));
|
||||||
appfeature.setCfgRegionValue(regionDict.getConfigRegionValue());
|
appfeature.setCfgRegionValue(regionDict.getConfigRegionValue());
|
||||||
appfeature.setCfgRegionType(String.valueOf(regionDict.getRegionType()));
|
appfeature.setCfgRegionType(String.valueOf(regionDict.getRegionType()));
|
||||||
@@ -1816,6 +1865,7 @@ public class BaseController {
|
|||||||
_stringCfgs.clear();
|
_stringCfgs.clear();
|
||||||
}
|
}
|
||||||
} else if (regionDict.getRegionType().equals(3)) {
|
} else if (regionDict.getRegionType().equals(3)) {
|
||||||
|
if(!regionDict.getFunctionId().equals(563)) {
|
||||||
List<ComplexkeywordCfg> _complexkeywordCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
List<ComplexkeywordCfg> _complexkeywordCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||||
while(!complexkeywordCfgs.isEmpty()) {
|
while(!complexkeywordCfgs.isEmpty()) {
|
||||||
complexkeywordCfgs.drainTo(_complexkeywordCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
complexkeywordCfgs.drainTo(_complexkeywordCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||||
@@ -1910,10 +1960,10 @@ public class BaseController {
|
|||||||
|| regionDict.getFunctionId().intValue()==564){
|
|| regionDict.getFunctionId().intValue()==564){
|
||||||
AppFeatureIndex appfeature = new AppFeatureIndex();
|
AppFeatureIndex appfeature = new AppFeatureIndex();
|
||||||
BeanUtils.copyProperties(cfg, appfeature,new String[] {"cfgId"});
|
BeanUtils.copyProperties(cfg, appfeature,new String[] {"cfgId"});
|
||||||
if(appFeatureRegion!=null){
|
if(regionDict!=null){
|
||||||
appfeature.setCfgRegionCode1(String.valueOf(appFeatureRegion.getConfigRegionCode()));
|
appfeature.setCfgRegionCode1(String.valueOf(regionDict.getConfigRegionCode()));
|
||||||
appfeature.setCfgRegionValue(appFeatureRegion.getConfigRegionValue());
|
appfeature.setCfgRegionValue(regionDict.getConfigRegionValue());
|
||||||
appfeature.setCfgRegionType(String.valueOf(appFeatureRegion.getRegionType()));
|
appfeature.setCfgRegionType(String.valueOf(regionDict.getRegionType()));
|
||||||
}
|
}
|
||||||
appFeatureIndexs.add(appfeature);
|
appFeatureIndexs.add(appfeature);
|
||||||
}
|
}
|
||||||
@@ -1924,6 +1974,90 @@ public class BaseController {
|
|||||||
cfgIndexInfos.clear();
|
cfgIndexInfos.clear();
|
||||||
appPolicyCfgs.clear();
|
appPolicyCfgs.clear();
|
||||||
_complexkeywordCfgs.clear();
|
_complexkeywordCfgs.clear();
|
||||||
|
appFeatureIndexs.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
}else {
|
||||||
|
// APP Payload处理
|
||||||
|
List<AppComplexFeatureCfg> _complexkeywordCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
while(!appComplexFeatureCfgs.isEmpty()) {
|
||||||
|
appComplexFeatureCfgs.drainTo(_complexkeywordCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||||
|
List<Integer> compileIds=Lists.newArrayList();
|
||||||
|
List<Integer> groupIds=Lists.newArrayList();
|
||||||
|
List<Integer> regionIds=Lists.newArrayList();
|
||||||
|
try {
|
||||||
|
compileIds = ConfigServiceUtil.getId(1,_complexkeywordCfgs.size());
|
||||||
|
if(isSend.equals("1")) {
|
||||||
|
groupIds = ConfigServiceUtil.getId(2,_complexkeywordCfgs.size());
|
||||||
|
regionIds = ConfigServiceUtil.getId(3,_complexkeywordCfgs.size());
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
logger.info("获取编译ID出错");
|
||||||
|
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||||
|
}
|
||||||
|
int ind=0;
|
||||||
|
for (AppComplexFeatureCfg cfg : _complexkeywordCfgs) {
|
||||||
|
cfg.setAction(serviceDict.getAction());
|
||||||
|
/*cfg.setAuditorId(UserUtils.getUser().getId());
|
||||||
|
cfg.setAuditTime(date);*/
|
||||||
|
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||||
|
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||||
|
cfg.setCreateTime(date);
|
||||||
|
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||||
|
cfg.setDoLog(2);
|
||||||
|
cfg.setFunctionId(regionDict.getFunctionId());
|
||||||
|
if(isSend.equals("1")) {
|
||||||
|
cfg.setIsAudit(Constants.AUDIT_YES);
|
||||||
|
cfg.setIsValid(Constants.VALID_YES);
|
||||||
|
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||||
|
cfg.setAuditTime(date);
|
||||||
|
if(groupIds!=null&&groupIds.size()==_complexkeywordCfgs.size()) {
|
||||||
|
cfg.setGroupId(groupIds.get(ind));
|
||||||
|
}
|
||||||
|
if(regionIds!=null&®ionIds.size()==_complexkeywordCfgs.size()) {
|
||||||
|
cfg.setRegionId(regionIds.get(ind));
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||||
|
cfg.setIsValid(Constants.VALID_NO);
|
||||||
|
}
|
||||||
|
//cfg.setIsAudit(0);
|
||||||
|
//cfg.setIsValid(0);
|
||||||
|
cfg.setIsAreaEffective(0);
|
||||||
|
cfg.setLable("0");
|
||||||
|
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||||
|
cfg.setAttribute(attribute);
|
||||||
|
cfg.setClassify(classify);
|
||||||
|
cfg.setServiceId(serviceDict.getServiceId());
|
||||||
|
if(compileIds!=null&&compileIds.size()==_complexkeywordCfgs.size()) {
|
||||||
|
cfg.setCompileId(compileIds.get(ind));
|
||||||
|
}
|
||||||
|
if(specificServiceCfg!=null) {
|
||||||
|
cfg.setAppCode(specificServiceCfg.getSpecServiceCode());
|
||||||
|
cfg.setSpecServiceId(specificServiceCfg.getSpecServiceId());
|
||||||
|
if(StringUtils.isNotBlank(behaviorId))
|
||||||
|
cfg.setBehavCode(Integer.parseInt(behaviorId));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
AppFeatureIndex appfeature = new AppFeatureIndex();
|
||||||
|
BeanUtils.copyProperties(cfg, appfeature,new String[] {"cfgId"});
|
||||||
|
if(regionDict!=null){
|
||||||
|
appfeature.setCfgRegionCode1(String.valueOf(regionDict.getConfigRegionCode()));
|
||||||
|
appfeature.setCfgRegionValue(regionDict.getConfigRegionValue());
|
||||||
|
appfeature.setCfgRegionType(String.valueOf(regionDict.getRegionType()));
|
||||||
|
}
|
||||||
|
appFeatureIndexs.add(appfeature);
|
||||||
|
|
||||||
|
ind++;
|
||||||
|
}
|
||||||
|
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _complexkeywordCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,isSend.equals("1"));
|
||||||
|
cfgIndexInfos.clear();
|
||||||
|
appPolicyCfgs.clear();
|
||||||
|
_complexkeywordCfgs.clear();
|
||||||
|
appFeatureIndexs.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}else if(regionDict.getRegionType().equals(6)) {
|
}else if(regionDict.getRegionType().equals(6)) {
|
||||||
if(regionDict.getFunctionId().equals(400)) {
|
if(regionDict.getFunctionId().equals(400)) {
|
||||||
@@ -2061,6 +2195,8 @@ public class BaseController {
|
|||||||
ei.loadInitParams(HttpsRedirectComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
ei.loadInitParams(HttpsRedirectComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||||
ei.loadInitParams(HttpsReplaceComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
ei.loadInitParams(HttpsReplaceComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
|
}else if(regionDict.getFunctionId().equals(563)) {// APP Payload
|
||||||
|
ei.loadInitParams(AppPayloadTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||||
} else {
|
} else {
|
||||||
ei.loadInitParams(ComplexStringAllTemplate.class, msgProp, regionDict, serviceDict);
|
ei.loadInitParams(ComplexStringAllTemplate.class, msgProp, regionDict, serviceDict);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import com.nis.domain.configuration.CfgIndexInfo;
|
|||||||
import com.nis.domain.configuration.IpPortCfg;
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||||
import com.nis.domain.configuration.template.AppDomainTemplate;
|
import com.nis.domain.configuration.template.AppDomainTemplate;
|
||||||
|
import com.nis.domain.configuration.template.AppPayloadTemplate;
|
||||||
import com.nis.domain.configuration.template.AsnIpTemplate;
|
import com.nis.domain.configuration.template.AsnIpTemplate;
|
||||||
import com.nis.domain.configuration.template.ComplexStringAllTemplate;
|
import com.nis.domain.configuration.template.ComplexStringAllTemplate;
|
||||||
import com.nis.domain.configuration.template.DdosIpTemplate;
|
import com.nis.domain.configuration.template.DdosIpTemplate;
|
||||||
@@ -460,6 +461,11 @@ public class IpController extends BaseController{
|
|||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsReplaceComplexTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, HttpsReplaceComplexTemplate.class, 2);
|
||||||
excel.setDataList(this.getMsgProp(),classList,null).
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
write(request,response, fileName).dispose();
|
write(request,response, fileName).dispose();
|
||||||
|
}else if(regionDict.getFunctionId().equals(563)) {// APP Payload
|
||||||
|
List<AppPayloadTemplate> classList=new ArrayList<AppPayloadTemplate>();
|
||||||
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,this.getMsgProp(),null, AppPayloadTemplate.class, 2);
|
||||||
|
excel.setDataList(this.getMsgProp(),classList,null).
|
||||||
|
write(request,response, fileName).dispose();
|
||||||
}else{
|
}else{
|
||||||
List<ComplexStringAllTemplate> classList=new ArrayList<ComplexStringAllTemplate>();
|
List<ComplexStringAllTemplate> classList=new ArrayList<ComplexStringAllTemplate>();
|
||||||
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, ComplexStringAllTemplate.class, 2);
|
ExportExcel excel=new ExportExcel(serviceDict,regionDict,pro,null, ComplexStringAllTemplate.class, 2);
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class TrafficStatisticsReportController extends BaseController {
|
|||||||
if ("3".endsWith(searchBusinessType)) {
|
if ("3".endsWith(searchBusinessType)) {
|
||||||
model.addAttribute("searchBusinessType", 3);// IP查询
|
model.addAttribute("searchBusinessType", 3);// IP查询
|
||||||
}
|
}
|
||||||
String url = Configurations.getStringProperty("dashboardUrlV2","dashboardUrlV2") + Constants.NTC_RADIUS_REPORT;
|
String url = Constants.DASHBOARD_URL + Constants.NTC_RADIUS_REPORT;
|
||||||
String statTime = bean.getSearchFoundStartTime();
|
String statTime = bean.getSearchFoundStartTime();
|
||||||
String endTime = bean.getSearchFoundEndTime();
|
String endTime = bean.getSearchFoundEndTime();
|
||||||
String account = bean.getAccount();
|
String account = bean.getAccount();
|
||||||
@@ -222,7 +222,7 @@ public class TrafficStatisticsReportController extends BaseController {
|
|||||||
if ("3".endsWith(searchBusinessType)) {
|
if ("3".endsWith(searchBusinessType)) {
|
||||||
model.addAttribute("searchBusinessType", 3);// IP查询
|
model.addAttribute("searchBusinessType", 3);// IP查询
|
||||||
}
|
}
|
||||||
String url = Configurations.getStringProperty("dashboardUrlV2","dashboardUrlV2")+ Constants.NTC_RADIUS_REPORT;
|
String url = Constants.DASHBOARD_URL+ Constants.NTC_RADIUS_REPORT;
|
||||||
String statTime = bean.getSearchFoundStartTime();
|
String statTime = bean.getSearchFoundStartTime();
|
||||||
String endTime = bean.getSearchFoundEndTime();
|
String endTime = bean.getSearchFoundEndTime();
|
||||||
String account = bean.getAccount();
|
String account = bean.getAccount();
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ public interface AppMultiFeatureCfgDao {
|
|||||||
public void deleteAppTcpCfg(BaseCfg entity);
|
public void deleteAppTcpCfg(BaseCfg entity);
|
||||||
|
|
||||||
public int insertAppComplexFeatureCfg(AppComplexFeatureCfg entity);
|
public int insertAppComplexFeatureCfg(AppComplexFeatureCfg entity);
|
||||||
|
public int insertAppComplexFeatureCfgBatch(AppComplexFeatureCfg entity);
|
||||||
public void deleteAppComplexFeatureCfg(BaseCfg entity);
|
public void deleteAppComplexFeatureCfg(BaseCfg entity);
|
||||||
//IP RANGE配置
|
//IP RANGE配置
|
||||||
public List<AppIpCfg> getAppIpRangeCfg(@Param("compileId")Integer compileId,@Param("functionId")Integer functionId) ;
|
public List<AppIpCfg> getAppIpRangeCfg(@Param("compileId")Integer compileId,@Param("functionId")Integer functionId) ;
|
||||||
|
|||||||
@@ -553,6 +553,29 @@
|
|||||||
#{icmpCode,jdbcType=VARCHAR},#{icmpIdentifier,jdbcType=VARCHAR},#{headerType,jdbcType=VARCHAR}
|
#{icmpCode,jdbcType=VARCHAR},#{icmpIdentifier,jdbcType=VARCHAR},#{headerType,jdbcType=VARCHAR}
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
<!-- 批量新增APP增强字符串类特征子配置 -->
|
||||||
|
<insert id="insertAppComplexFeatureCfgBatch" parameterType="com.nis.domain.configuration.AppComplexFeatureCfg" >
|
||||||
|
insert into app_complex_feature_cfg (
|
||||||
|
APP_CODE,BEHAV_CODE,SPEC_SERVICE_ID,CFG_DESC,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,AREA_EFFECTIVE_IDS,FUNCTION_ID,CFG_TYPE,CFG_REGION_CODE,
|
||||||
|
DISTRICT,CFG_KEYWORDS,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG,user_region1,user_region2,user_region3,user_region4,user_region5,
|
||||||
|
ver,ihl,tos,total_length,flags,fragment_offset,protocol,icmp_type,icmp_code,icmp_identifier,header_type
|
||||||
|
)values (
|
||||||
|
<include refid="AppCommonCfg_Value_List" />,
|
||||||
|
#{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER},
|
||||||
|
#{district,jdbcType=VARCHAR},#{cfgKeywords,jdbcType=VARCHAR},
|
||||||
|
#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER},
|
||||||
|
#{doLog,jdbcType=INTEGER},#{userRegion1,jdbcType=VARCHAR},#{userRegion2,jdbcType=VARCHAR},
|
||||||
|
#{userRegion3,jdbcType=VARCHAR},#{userRegion4,jdbcType=VARCHAR},#{userRegion5,jdbcType=VARCHAR},
|
||||||
|
#{ver,jdbcType=VARCHAR},#{ihl,jdbcType=VARCHAR},#{tos,jdbcType=VARCHAR},#{totalLength,jdbcType=VARCHAR},
|
||||||
|
#{flags,jdbcType=VARCHAR},#{fragmentOffset,jdbcType=VARCHAR},#{protocol,jdbcType=VARCHAR},#{icmpType,jdbcType=VARCHAR},
|
||||||
|
#{icmpCode,jdbcType=VARCHAR},#{icmpIdentifier,jdbcType=VARCHAR},#{headerType,jdbcType=VARCHAR}
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
<!-- 新增APP字符串类特征子配置 -->
|
<!-- 新增APP字符串类特征子配置 -->
|
||||||
<insert id="insertAppStringFeatureCfg" parameterType="com.nis.domain.configuration.AppStringFeatureCfg" >
|
<insert id="insertAppStringFeatureCfg" parameterType="com.nis.domain.configuration.AppStringFeatureCfg" >
|
||||||
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
|
||||||
|
|||||||
@@ -97,4 +97,6 @@ public interface ConfigSynchronizationDao {
|
|||||||
public List<ComplexkeywordCfg> getComplexStrListByService(BaseCfg entity);
|
public List<ComplexkeywordCfg> getComplexStrListByService(BaseCfg entity);
|
||||||
public List<IpPortCfg> getAppIpPortList(@Param("tableName")String tableName,@Param("compileIds")List compileIds);
|
public List<IpPortCfg> getAppIpPortList(@Param("tableName")String tableName,@Param("compileIds")List compileIds);
|
||||||
public List<AppIpCfg> getAppIpFeatureList(BaseCfg entity);
|
public List<AppIpCfg> getAppIpFeatureList(BaseCfg entity);
|
||||||
|
|
||||||
|
public void updateCfgStatus(BaseCfg entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1582,6 +1582,26 @@
|
|||||||
AND a.CFG_ID!=#{cfgId,jdbcType=BIGINT}
|
AND a.CFG_ID!=#{cfgId,jdbcType=BIGINT}
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 配置状态启停,定时任务使用 -->
|
||||||
|
<update id="updateCfgStatus" parameterType="com.nis.domain.configuration.BaseCfg">
|
||||||
|
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER},
|
||||||
|
edit_time = #{editTime,jdbcType=TIMESTAMP}
|
||||||
|
<if test="isAudit != null" >
|
||||||
|
,is_audit = #{isAudit,jdbcType=INTEGER}
|
||||||
|
,audit_time=#{auditTime,jdbcType=TIMESTAMP}
|
||||||
|
</if>
|
||||||
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||||
|
<if test="cfgId !=null ">
|
||||||
|
AND cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||||
|
</if>
|
||||||
|
<if test="compileId !=null ">
|
||||||
|
AND compile_id = #{compileId,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
and function_id=#{functionId,jdbcType=INTEGER}
|
||||||
|
</trim>
|
||||||
|
</update>
|
||||||
<!-- <select id="findAppPolicyList" resultMap="AppPolicyCfgMap" parameterType="com.nis.domain.configuration.AppPolicyCfg" >
|
<!-- <select id="findAppPolicyList" resultMap="AppPolicyCfgMap" parameterType="com.nis.domain.configuration.AppPolicyCfg" >
|
||||||
select
|
select
|
||||||
<include refid="AppPolicyCfg_Column"/>
|
<include refid="AppPolicyCfg_Column"/>
|
||||||
|
|||||||
@@ -1613,6 +1613,8 @@ public abstract class BaseService {
|
|||||||
type="DnsResStrategy";
|
type="DnsResStrategy";
|
||||||
}else if(list.get(0) instanceof AsnIpCfg) {
|
}else if(list.get(0) instanceof AsnIpCfg) {
|
||||||
type="AsnIpCfg";
|
type="AsnIpCfg";
|
||||||
|
}else if(list.get(0) instanceof AppComplexFeatureCfg) {
|
||||||
|
type="AppComplexFeature";
|
||||||
}
|
}
|
||||||
if (cfgIndexInfos != null && cfgIndexInfos.size() > 0) {
|
if (cfgIndexInfos != null && cfgIndexInfos.size() > 0) {
|
||||||
this.saveCfgIndexOf(cfgIndexInfos);
|
this.saveCfgIndexOf(cfgIndexInfos);
|
||||||
@@ -1634,6 +1636,9 @@ public abstract class BaseService {
|
|||||||
}else if("AsnIpCfg".equals(type)) {
|
}else if("AsnIpCfg".equals(type)) {
|
||||||
List<AsnIpCfg> listPage = (List<AsnIpCfg>) list;
|
List<AsnIpCfg> listPage = (List<AsnIpCfg>) list;
|
||||||
this.saveAsnIpBatch(listPage);
|
this.saveAsnIpBatch(listPage);
|
||||||
|
}else if("AppComplexFeature".equals(type)) {
|
||||||
|
List<AppComplexFeatureCfg> listPage = (List<AppComplexFeatureCfg>) list;
|
||||||
|
this.saveAppComplexFeatureBatch(listPage);
|
||||||
}else if("BaseStringCfg".equals(type)) {
|
}else if("BaseStringCfg".equals(type)) {
|
||||||
List<BaseStringCfg<?>> listPage = (List<BaseStringCfg<?>>) list;
|
List<BaseStringCfg<?>> listPage = (List<BaseStringCfg<?>>) list;
|
||||||
// 调用对应配置的service
|
// 调用对应配置的service
|
||||||
@@ -1815,6 +1820,30 @@ public abstract class BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP Payload导入配置时数据批量入库
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
|
public void saveAppComplexFeatureBatch(List<AppComplexFeatureCfg> data) {
|
||||||
|
SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class);
|
||||||
|
SqlSession batchSqlSession = null;
|
||||||
|
try{
|
||||||
|
batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false);
|
||||||
|
for(int index = 0; index < data.size();index++){
|
||||||
|
AppComplexFeatureCfg cfg = data.get(index);
|
||||||
|
((AppMultiFeatureCfgDao) batchSqlSession.getMapper(AppMultiFeatureCfgDao.class)).insertAppComplexFeatureCfgBatch(cfg);
|
||||||
|
}
|
||||||
|
batchSqlSession.commit();
|
||||||
|
}finally {
|
||||||
|
if(batchSqlSession != null){
|
||||||
|
batchSqlSession.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 同一个app下的ip批量保存
|
* 同一个app下的ip批量保存
|
||||||
* @param cfgs
|
* @param cfgs
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ 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.Properties;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
@@ -20,6 +22,7 @@ import com.nis.domain.configuration.AppIpCfg;
|
|||||||
import com.nis.domain.configuration.AppStringFeatureCfg;
|
import com.nis.domain.configuration.AppStringFeatureCfg;
|
||||||
import com.nis.domain.configuration.AppTcpCfg;
|
import com.nis.domain.configuration.AppTcpCfg;
|
||||||
import com.nis.domain.configuration.CfgIndexInfo;
|
import com.nis.domain.configuration.CfgIndexInfo;
|
||||||
|
import com.nis.domain.configuration.ComplexkeywordCfg;
|
||||||
import com.nis.domain.configuration.HttpUrlCfg;
|
import com.nis.domain.configuration.HttpUrlCfg;
|
||||||
import com.nis.domain.configuration.IpPortCfg;
|
import com.nis.domain.configuration.IpPortCfg;
|
||||||
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
import com.nis.domain.configuration.NtcSubscribeIdCfg;
|
||||||
@@ -111,43 +114,9 @@ public class AppMultiFeatureCfgService extends BaseService {
|
|||||||
cfg.setIsCaseInsenstive(0);
|
cfg.setIsCaseInsenstive(0);
|
||||||
cfg.setExprType(3);
|
cfg.setExprType(3);
|
||||||
cfg.setMatchMethod(0);
|
cfg.setMatchMethod(0);
|
||||||
String keyword = "";
|
this.setL3HeaderKeyword(cfg);
|
||||||
if(cfg.getHeaderType().equals("IP_header")){
|
|
||||||
if(StringUtils.isNoneBlank(cfg.getVer())){
|
|
||||||
keyword += "0-3:"+cfg.getVer()+Constants.KEYWORD_EXPR;
|
|
||||||
}
|
|
||||||
if(StringUtils.isNotBlank(cfg.getIhl())){
|
|
||||||
keyword += "4-7:"+cfg.getIhl()+Constants.KEYWORD_EXPR;
|
|
||||||
}
|
|
||||||
if(StringUtils.isNotBlank(cfg.getTos())){
|
|
||||||
keyword += "8-15:"+cfg.getTos()+Constants.KEYWORD_EXPR;
|
|
||||||
}
|
|
||||||
if(StringUtils.isNotBlank(cfg.getTotalLength())){
|
|
||||||
keyword += "16-31:"+cfg.getTotalLength()+Constants.KEYWORD_EXPR;
|
|
||||||
}
|
|
||||||
if(StringUtils.isNotBlank(cfg.getFlags())){
|
|
||||||
keyword += "48-50:"+cfg.getFlags()+Constants.KEYWORD_EXPR;
|
|
||||||
}
|
|
||||||
if(StringUtils.isNotBlank(cfg.getFragmentOffset())){
|
|
||||||
keyword += "56-63:"+cfg.getFragmentOffset()+Constants.KEYWORD_EXPR;
|
|
||||||
}
|
|
||||||
if(StringUtils.isNotBlank(cfg.getProtocol())){
|
|
||||||
keyword += "72-79:"+cfg.getProtocol()+Constants.KEYWORD_EXPR;
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
if(StringUtils.isNoneBlank(cfg.getIcmpType())){
|
|
||||||
keyword += "0-7:"+cfg.getIcmpType()+Constants.KEYWORD_EXPR;
|
|
||||||
}
|
|
||||||
if(StringUtils.isNotBlank(cfg.getIcmpCode())){
|
|
||||||
keyword += "8-15:"+cfg.getIcmpCode()+Constants.KEYWORD_EXPR;
|
|
||||||
}
|
|
||||||
if(StringUtils.isNotBlank(cfg.getIcmpIdentifier())){
|
|
||||||
keyword += "32-47:"+cfg.getIcmpIdentifier()+Constants.KEYWORD_EXPR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
keyword=keyword.substring(0,keyword.lastIndexOf(Constants.KEYWORD_EXPR));
|
|
||||||
cfg.setCfgKeywords(keyword);
|
|
||||||
appMultiFeatureCfgDao.insertAppComplexFeatureCfg(cfg);
|
appMultiFeatureCfgDao.insertAppComplexFeatureCfg(cfg);
|
||||||
|
|
||||||
}else if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
}else if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
cfg.setHeaderType(null);
|
cfg.setHeaderType(null);
|
||||||
@@ -205,6 +174,28 @@ public class AppMultiFeatureCfgService extends BaseService {
|
|||||||
cfg.setIsCaseInsenstive(0);
|
cfg.setIsCaseInsenstive(0);
|
||||||
cfg.setExprType(3);
|
cfg.setExprType(3);
|
||||||
cfg.setMatchMethod(0);
|
cfg.setMatchMethod(0);
|
||||||
|
this.setL3HeaderKeyword(cfg);
|
||||||
|
appMultiFeatureCfgDao.insertAppComplexFeatureCfg(cfg);
|
||||||
|
|
||||||
|
}else if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
cfg.setHeaderType(null);
|
||||||
|
appMultiFeatureCfgDao.insertAppComplexFeatureCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entity.getNumCfgList()!=null){
|
||||||
|
for(AppTcpCfg cfg:entity.getNumCfgList()){
|
||||||
|
if(cfg.getLowBoundary()!=null && cfg.getUpBoundary()!=null){
|
||||||
|
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
|
appMultiFeatureCfgDao.insertAppTcpCfg(cfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setL3HeaderKeyword(AppComplexFeatureCfg cfg) {
|
||||||
String keyword = "";
|
String keyword = "";
|
||||||
if(cfg.getHeaderType().equals("IP_header")){
|
if(cfg.getHeaderType().equals("IP_header")){
|
||||||
if(StringUtils.isNoneBlank(cfg.getVer())){
|
if(StringUtils.isNoneBlank(cfg.getVer())){
|
||||||
@@ -241,24 +232,8 @@ public class AppMultiFeatureCfgService extends BaseService {
|
|||||||
}
|
}
|
||||||
keyword=keyword.substring(0,keyword.lastIndexOf(Constants.KEYWORD_EXPR));
|
keyword=keyword.substring(0,keyword.lastIndexOf(Constants.KEYWORD_EXPR));
|
||||||
cfg.setCfgKeywords(keyword);
|
cfg.setCfgKeywords(keyword);
|
||||||
appMultiFeatureCfgDao.insertAppComplexFeatureCfg(cfg);
|
|
||||||
}else if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
|
||||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
|
||||||
cfg.setHeaderType(null);
|
|
||||||
appMultiFeatureCfgDao.insertAppComplexFeatureCfg(cfg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(entity.getNumCfgList()!=null){
|
|
||||||
for(AppTcpCfg cfg:entity.getNumCfgList()){
|
|
||||||
if(cfg.getLowBoundary()!=null && cfg.getUpBoundary()!=null){
|
|
||||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
|
||||||
appMultiFeatureCfgDao.insertAppTcpCfg(cfg);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void auditAppFeatureCfg(AppFeatureIndex entity, Integer isAudit) {
|
public void auditAppFeatureCfg(AppFeatureIndex entity, Integer isAudit) {
|
||||||
ToMaatBean maatBean = new ToMaatBean();
|
ToMaatBean maatBean = new ToMaatBean();
|
||||||
MaatCfg maatCfg = new MaatCfg();
|
MaatCfg maatCfg = new MaatCfg();
|
||||||
@@ -460,4 +435,219 @@ public class AppMultiFeatureCfgService extends BaseService {
|
|||||||
return dataMap;
|
return dataMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* APP Payload L3_HEADER导入操作特殊属性限制
|
||||||
|
* @param baseStringCfg
|
||||||
|
* @param errInfo
|
||||||
|
* @param prop
|
||||||
|
*/
|
||||||
|
public void checkImportAppPayload(AppComplexFeatureCfg baseStringCfg, StringBuffer errInfo, Properties prop) {
|
||||||
|
String headerType = baseStringCfg.getHeaderType();
|
||||||
|
String ver = baseStringCfg.getVer();
|
||||||
|
String ihl = baseStringCfg.getIhl();
|
||||||
|
String tos = baseStringCfg.getTos();
|
||||||
|
String totalLength = baseStringCfg.getTotalLength();
|
||||||
|
String flags = baseStringCfg.getFlags();
|
||||||
|
String fragmentOffset = baseStringCfg.getFragmentOffset();
|
||||||
|
String protocol = baseStringCfg.getProtocol();
|
||||||
|
String icmpType = baseStringCfg.getIcmpType();
|
||||||
|
String icmpCode = baseStringCfg.getIcmpCode();
|
||||||
|
String icmpIdentifier = baseStringCfg.getIcmpIdentifier();
|
||||||
|
|
||||||
|
boolean errorFlag = false;// 除“can_not_null”外其它错误 标识
|
||||||
|
Pattern pattern = Pattern.compile("^([0-9|a-f|A-F]*)$");
|
||||||
|
StringBuffer errInfoCopy = new StringBuffer();
|
||||||
|
errInfoCopy.append(errInfo);
|
||||||
|
|
||||||
|
if("IP_header".equals(headerType)) {
|
||||||
|
boolean ipHeaderFlag = false;
|
||||||
|
List<Object> ipHeaderList = new ArrayList<>();
|
||||||
|
if(StringUtils.isNotBlank(baseStringCfg.getVer())) { ipHeaderList.add(baseStringCfg.getVer()); }
|
||||||
|
if(StringUtils.isNotBlank(baseStringCfg.getIhl())) { ipHeaderList.add(baseStringCfg.getIhl()); }
|
||||||
|
if(StringUtils.isNotBlank(baseStringCfg.getTos())) { ipHeaderList.add(baseStringCfg.getTos()); }
|
||||||
|
if(StringUtils.isNotBlank(baseStringCfg.getTotalLength())) { ipHeaderList.add(baseStringCfg.getTotalLength()); }
|
||||||
|
if(StringUtils.isNotBlank(baseStringCfg.getFlags())) { ipHeaderList.add(baseStringCfg.getFlags()); }
|
||||||
|
if(StringUtils.isNotBlank(baseStringCfg.getFragmentOffset())) { ipHeaderList.add(baseStringCfg.getFragmentOffset()); }
|
||||||
|
if(StringUtils.isNotBlank(baseStringCfg.getProtocol())) { ipHeaderList.add(baseStringCfg.getProtocol()); }
|
||||||
|
if(ipHeaderList.size() > 4) {// IP_header最多填写四个属性值
|
||||||
|
errInfo.append("IP_header " + prop.getProperty("l3_header_error")+";");
|
||||||
|
}else {
|
||||||
|
ipHeaderFlag = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
int count = 0;
|
||||||
|
if(StringUtils.isBlank(ver) && ipHeaderFlag) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), "VER ") + ";");
|
||||||
|
}else if(ver.trim().length() != 4 && ipHeaderFlag){
|
||||||
|
errInfo.append(
|
||||||
|
"VER "+prop.getProperty("length_error") + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else if(!pattern.matcher(ver).matches() && ipHeaderFlag) {
|
||||||
|
errInfo.append(
|
||||||
|
"VER "+ " '" + ver + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(StringUtils.isBlank(ihl) && ipHeaderFlag) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), "IHL ") + ";");
|
||||||
|
}else if(ihl.trim().length() != 4 && ipHeaderFlag){
|
||||||
|
errInfo.append(
|
||||||
|
"IHL "+prop.getProperty("length_error") + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else if(!pattern.matcher(ihl).matches() && ipHeaderFlag) {
|
||||||
|
errInfo.append(
|
||||||
|
"IHL "+ " '" + ihl + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(StringUtils.isBlank(tos) && ipHeaderFlag) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), "TOS ") + ";");
|
||||||
|
}else if(tos.trim().length() != 8 && ipHeaderFlag){
|
||||||
|
errInfo.append(
|
||||||
|
"TOS "+prop.getProperty("length_error") + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else if(!pattern.matcher(tos).matches() && ipHeaderFlag) {
|
||||||
|
errInfo.append(
|
||||||
|
"TOS "+ " '" + tos + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(StringUtils.isBlank(totalLength) && ipHeaderFlag) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), "Total Length ") + ";");
|
||||||
|
}else if(totalLength.trim().length() != 16 && ipHeaderFlag){
|
||||||
|
errInfo.append(
|
||||||
|
"Total Length "+prop.getProperty("length_error") + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else if(!pattern.matcher(totalLength).matches() && ipHeaderFlag) {
|
||||||
|
errInfo.append(
|
||||||
|
"Total Length "+ " '" + totalLength + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(StringUtils.isBlank(flags) && ipHeaderFlag) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), "Flags ") + ";");
|
||||||
|
}else if(flags.trim().length() != 3 && ipHeaderFlag){
|
||||||
|
errInfo.append(
|
||||||
|
"Flags "+prop.getProperty("length_error") + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else if(!pattern.matcher(flags).matches() && ipHeaderFlag) {
|
||||||
|
errInfo.append(
|
||||||
|
"Flags "+ " '" + flags + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(StringUtils.isBlank(fragmentOffset) && ipHeaderFlag) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), "fragment offset ") + ";");
|
||||||
|
}else if(fragmentOffset.trim().length() != 8 && ipHeaderFlag){
|
||||||
|
errInfo.append(
|
||||||
|
"fragment offset "+prop.getProperty("length_error") + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else if(!pattern.matcher(fragmentOffset).matches() && ipHeaderFlag) {
|
||||||
|
errInfo.append(
|
||||||
|
"fragment offset "+ " '" + fragmentOffset + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(StringUtils.isBlank(protocol) && ipHeaderFlag) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), "Protocol ") + ";");
|
||||||
|
}else if(protocol.trim().length() != 8 && ipHeaderFlag){
|
||||||
|
errInfo.append(
|
||||||
|
"Protocol "+prop.getProperty("length_error") + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else if(!pattern.matcher(protocol).matches() && ipHeaderFlag) {
|
||||||
|
errInfo.append(
|
||||||
|
"Protocol "+ " '" + protocol + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((count >0 || count <5) && (!errorFlag) && (ipHeaderFlag)) {// 清空错误信息
|
||||||
|
errInfo.setLength(0);;
|
||||||
|
errInfo.append(errInfoCopy);
|
||||||
|
}
|
||||||
|
baseStringCfg.setIcmpType(null);
|
||||||
|
baseStringCfg.setIcmpCode(null);
|
||||||
|
baseStringCfg.setIcmpIdentifier(null);
|
||||||
|
}else {
|
||||||
|
int count = 0;
|
||||||
|
if(StringUtils.isBlank(icmpType)) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), "ICMP type ") + ";");
|
||||||
|
}else if(icmpType.trim().length() != 8){
|
||||||
|
errInfo.append(
|
||||||
|
"ICMP type "+prop.getProperty("length_error") + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else if(!pattern.matcher(icmpType).matches()) {
|
||||||
|
errInfo.append(
|
||||||
|
"ICMP type "+ " '" + icmpType + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(StringUtils.isBlank(icmpCode)) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), "ICMP code ") + ";");
|
||||||
|
}else if(icmpCode.trim().length() != 8){
|
||||||
|
errInfo.append(
|
||||||
|
"ICMP code "+prop.getProperty("length_error") + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else if(!pattern.matcher(icmpCode).matches()) {
|
||||||
|
errInfo.append(
|
||||||
|
"ICMP code "+ " '" + icmpCode + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(StringUtils.isBlank(icmpIdentifier)) {
|
||||||
|
errInfo.append(
|
||||||
|
String.format(prop.getProperty("can_not_null"), "ICMP identifier ") + ";");
|
||||||
|
}else if(icmpIdentifier.trim().length() != 16){
|
||||||
|
errInfo.append(
|
||||||
|
"ICMP identifier "+prop.getProperty("length_error") + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else if(!pattern.matcher(icmpIdentifier).matches()) {
|
||||||
|
errInfo.append(
|
||||||
|
"ICMP identifier "+ " '" + icmpIdentifier + "' "+String.format(prop.getProperty("contains_non_hex_char")) + ";");
|
||||||
|
errorFlag = true;
|
||||||
|
}else {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((count >0) && (!errorFlag)) {// 清空错误信息
|
||||||
|
errInfo.setLength(0);;
|
||||||
|
errInfo.append(errInfoCopy);
|
||||||
|
}
|
||||||
|
baseStringCfg.setVer(null);
|
||||||
|
baseStringCfg.setIhl(null);
|
||||||
|
baseStringCfg.setTos(null);
|
||||||
|
baseStringCfg.setTotalLength(null);
|
||||||
|
baseStringCfg.setFlags(null);
|
||||||
|
baseStringCfg.setFragmentOffset(null);
|
||||||
|
baseStringCfg.setProtocol(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1439,3 +1439,9 @@ traffic_connect_log=Traffic Log
|
|||||||
keyword_log_to_url=KeywordLogToURL
|
keyword_log_to_url=KeywordLogToURL
|
||||||
http_log=HTTP Logs
|
http_log=HTTP Logs
|
||||||
cut_sample_tool=Cut Sample Tool
|
cut_sample_tool=Cut Sample Tool
|
||||||
|
hex_minlength_3=Please enter a hexadecimal string of length 3
|
||||||
|
hex_minlength_4=Please enter a hexadecimal string of length 4
|
||||||
|
hex_minlength_8=Please enter a hexadecimal string of length 8
|
||||||
|
hex_minlength_16=Please enter a hexadecimal string of length 16
|
||||||
|
need_input=Attributes need to be filled in
|
||||||
|
max_input=Fill in at most four
|
||||||
@@ -1443,3 +1443,9 @@ traffic_connect_log=\u0416\u0443\u0440\u043D\u0430\u043B \u0422\u0440\u0430\u044
|
|||||||
keyword_log_to_url=KeywordLogToURL
|
keyword_log_to_url=KeywordLogToURL
|
||||||
http_log=HTTP Logs
|
http_log=HTTP Logs
|
||||||
cut_sample_tool=Cut Sample Tool
|
cut_sample_tool=Cut Sample Tool
|
||||||
|
hex_minlength_3=Please enter a hexadecimal string of length 3
|
||||||
|
hex_minlength_4=Please enter a hexadecimal string of length 4
|
||||||
|
hex_minlength_8=Please enter a hexadecimal string of length 8
|
||||||
|
hex_minlength_16=Please enter a hexadecimal string of length 16
|
||||||
|
need_input=Attributes need to be filled in
|
||||||
|
max_input=Fill in at most four
|
||||||
@@ -1439,3 +1439,9 @@ traffic_connect_log=\u6D41\u91CF\u65E5\u5FD7
|
|||||||
keyword_log_to_url=\u5173\u952E\u5B57\u65E5\u5FD7\u8F6CURL
|
keyword_log_to_url=\u5173\u952E\u5B57\u65E5\u5FD7\u8F6CURL
|
||||||
http_log=HTTP \u65E5\u5FD7
|
http_log=HTTP \u65E5\u5FD7
|
||||||
cut_sample_tool=\u6837\u4F8B\u526A\u5207\u5DE5\u5177
|
cut_sample_tool=\u6837\u4F8B\u526A\u5207\u5DE5\u5177
|
||||||
|
hex_minlength_3=\u8BF7\u8F93\u5165\u957F\u5EA6\u4E3A3\u7684\u5341\u516D\u8FDB\u5236\u5B57\u7B26\u4E32
|
||||||
|
hex_minlength_4=\u8BF7\u8F93\u5165\u957F\u5EA6\u4E3A4\u7684\u5341\u516D\u8FDB\u5236\u5B57\u7B26\u4E32
|
||||||
|
hex_minlength_8=\u8BF7\u8F93\u5165\u957F\u5EA6\u4E3A8\u7684\u5341\u516D\u8FDB\u5236\u5B57\u7B26\u4E32
|
||||||
|
hex_minlength_16=\u8BF7\u8F93\u5165\u957F\u5EA6\u4E3A16\u7684\u5341\u516D\u8FDB\u5236\u5B57\u7B26\u4E32
|
||||||
|
need_input=\u9700\u8981\u586B\u5199\u5C5E\u6027
|
||||||
|
max_input=\u6700\u591A\u586B\u5199\u56DB\u4E2A
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
-- APP Payload --
|
||||||
|
UPDATE function_region_dict SET is_import = 1 WHERE function_id = 563 AND dict_id = 211;
|
||||||
|
UPDATE function_region_dict SET is_import = 1 WHERE function_id = 563 AND dict_id = 212;
|
||||||
|
UPDATE function_service_dict SET is_import = 1 WHERE function_id = 563;
|
||||||
|
|
||||||
|
|
||||||
@@ -94,11 +94,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div for="action"></div>
|
<div for="action"></div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 600 asn ip、 3:IP白名单、 405:APP协议IP、 403:APP域名特征 -->
|
<!-- 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) }">
|
<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) }">
|
||||||
<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) }">
|
<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)}">
|
||||||
<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>
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
<input id="beginDate" name="beginDate" type="text"
|
<input id="beginDate" name="beginDate" type="text"
|
||||||
readonly="readonly" class="form-control Wdate input-medium"
|
readonly="readonly" class="form-control Wdate input-medium"
|
||||||
value=""
|
value=""
|
||||||
onclick="WdatePicker({onpicked:setTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/>
|
onclick="WdatePicker({onpicked:setTime(7),dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')||currentTime()}'});"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
@@ -45,10 +45,12 @@
|
|||||||
<span class="selectpicker form-control"><spring:message
|
<span class="selectpicker form-control"><spring:message
|
||||||
code="end_date" /></span>
|
code="end_date" /></span>
|
||||||
</div>
|
</div>
|
||||||
<input id="endDate" name="endDate" type="text"
|
<!-- <input id="endDate" name="endDate" type="text"
|
||||||
readonly="readonly" class="form-control Wdate input-medium"
|
readonly="readonly" class="form-control Wdate input-medium"
|
||||||
value=""
|
value=""
|
||||||
onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'#F{$dp.$D(\'beginDate\',{d:7})}'});" />
|
onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'#F{$dp.$D(\'beginDate\',{d:7})}'});" /> -->
|
||||||
|
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||||
|
value="" onclick="WdatePicker({el:'endDate',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:getMaxDate(7) })"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -76,7 +78,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>
|
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script> --%>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting-data.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting-data.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/standalone.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/standalone.js"></script>
|
||||||
@@ -118,10 +120,11 @@
|
|||||||
// 局点信息
|
// 局点信息
|
||||||
function showActionTransChart(xData,series) {
|
function showActionTransChart(xData,series) {
|
||||||
var nowDate=new Date();
|
var nowDate=new Date();
|
||||||
|
Highcharts.setOptions({ global: { useUTC: false } });
|
||||||
var chart = Highcharts.chart('chart',
|
var chart = Highcharts.chart('chart',
|
||||||
{
|
{
|
||||||
chart : {
|
chart : {
|
||||||
// type: 'area',
|
type: 'area',
|
||||||
zoomType : 'x'
|
zoomType : 'x'
|
||||||
},
|
},
|
||||||
noData:{
|
noData:{
|
||||||
@@ -163,8 +166,16 @@
|
|||||||
},
|
},
|
||||||
}, */
|
}, */
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type:'category',
|
type:'datetime',
|
||||||
categories: xData,
|
dateTimeLabelFormats: {
|
||||||
|
second: '%H:%M:%S',
|
||||||
|
minute: '%H:%M',
|
||||||
|
hour: '%H:%M',
|
||||||
|
day: '%m-%d',
|
||||||
|
week: '%m-%d',
|
||||||
|
month: '%Y-%m',
|
||||||
|
year: '%Y'
|
||||||
|
},
|
||||||
title: {
|
title: {
|
||||||
text: 'time',
|
text: 'time',
|
||||||
align:'high',
|
align:'high',
|
||||||
@@ -216,16 +227,19 @@
|
|||||||
var series = new Array();
|
var series = new Array();
|
||||||
var total = 0;
|
var total = 0;
|
||||||
if(rs!=null){
|
if(rs!=null){
|
||||||
$(rs.sum).each(function(i,d) {
|
/* $(rs.sum).each(function(i,d) {
|
||||||
total+=d
|
total+=d
|
||||||
})
|
})
|
||||||
xData = rs.statTime;
|
xData = rs.statTime; */
|
||||||
data =rs.sum;
|
data =rs.result;
|
||||||
}
|
}
|
||||||
$("#total").val(JSON.stringify(total));
|
$("#total").val(JSON.stringify(rs.sum));
|
||||||
series.push({
|
series.push({
|
||||||
name: 'sum',
|
name: 'sum',
|
||||||
data: data
|
data: data,
|
||||||
|
marker: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
});
|
});
|
||||||
showActionTransChart(xData,series);
|
showActionTransChart(xData,series);
|
||||||
closeTip();
|
closeTip();
|
||||||
@@ -291,9 +305,9 @@
|
|||||||
H.Chart.prototype.downloadCSV = function() {
|
H.Chart.prototype.downloadCSV = function() {
|
||||||
var rows = this.getDataRows(true);
|
var rows = this.getDataRows(true);
|
||||||
var data=new Array();
|
var data=new Array();
|
||||||
var total = total = JSON.parse($("#total").val());
|
var total = JSON.parse($("#total").val());
|
||||||
$(rows).each(function (i,d){
|
$(rows).each(function (i,d){
|
||||||
if(d!=null){
|
if(d!=null&&i>0){
|
||||||
data.push({
|
data.push({
|
||||||
num1:d[0],
|
num1:d[0],
|
||||||
num2:d[1]
|
num2:d[1]
|
||||||
|
|||||||
@@ -27,8 +27,10 @@
|
|||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||||
|
value="" onclick="WdatePicker({onpicked:setTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/> -->
|
||||||
<input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
<input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||||
value="" onclick="WdatePicker({onpicked:setTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/>
|
value="" onclick="WdatePicker({el:'beginDate',onpicked:setTime(7),dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:'#F{$dp.$D(\'endDate\')||currentTime()}' })" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
@@ -36,8 +38,10 @@
|
|||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||||
|
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'#F{$dp.$D(\'beginDate\',{d:7})}'});"/> -->
|
||||||
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'#F{$dp.$D(\'beginDate\',{d:7})}'});"/>
|
value="" onclick="WdatePicker({el:'endDate',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:getMaxDate(7) })"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -58,7 +62,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>
|
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>--%>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
||||||
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/themes/grid.js"></script> --%>
|
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/themes/grid.js"></script> --%>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting-data.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting-data.js"></script>
|
||||||
@@ -100,9 +104,10 @@ function searchList(){
|
|||||||
// 局点信息
|
// 局点信息
|
||||||
function showActionTransChart(xData,series){
|
function showActionTransChart(xData,series){
|
||||||
var nowDate=new Date();
|
var nowDate=new Date();
|
||||||
|
Highcharts.setOptions({ global: { useUTC: false } });
|
||||||
var chart = Highcharts.chart('chart', {
|
var chart = Highcharts.chart('chart', {
|
||||||
chart:{
|
chart:{
|
||||||
// type: 'area',
|
type: 'area',
|
||||||
zoomType: 'x'
|
zoomType: 'x'
|
||||||
},
|
},
|
||||||
exporting: {
|
exporting: {
|
||||||
@@ -133,15 +138,23 @@ function showActionTransChart(xData,series){
|
|||||||
text: null
|
text: null
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type:'category',
|
type:'datetime',
|
||||||
categories: xData,
|
dateTimeLabelFormats: {
|
||||||
|
second: '%H:%M:%S',
|
||||||
|
minute: '%H:%M',
|
||||||
|
hour: '%H:%M',
|
||||||
|
day: '%m-%d',
|
||||||
|
week: '%m-%d',
|
||||||
|
month: '%Y-%m',
|
||||||
|
year: '%Y'
|
||||||
|
},
|
||||||
title: {
|
title: {
|
||||||
text: 'time',
|
text: 'time',
|
||||||
align:'high',
|
align:'high',
|
||||||
},
|
},
|
||||||
labels: {
|
labels: {
|
||||||
rotation: -45, //倾斜的角度
|
rotation: -45, //倾斜的角度
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
title: {
|
title: {
|
||||||
@@ -185,10 +198,9 @@ function showActionTransChart(xData,series){
|
|||||||
var series=new Array();
|
var series=new Array();
|
||||||
var total=[];
|
var total=[];
|
||||||
if(rs!=null&&rs.length>0){
|
if(rs!=null&&rs.length>0){
|
||||||
xData=rs[0].statTime;
|
|
||||||
$(rs).each(function(i, d) {
|
$(rs).each(function(i, d) {
|
||||||
total.push(
|
total.push(
|
||||||
sum(d.count)
|
d.sum
|
||||||
)
|
)
|
||||||
var entrance="";
|
var entrance="";
|
||||||
if(d!=null&&d.entranceId==1){
|
if(d!=null&&d.entranceId==1){
|
||||||
@@ -199,7 +211,10 @@ function showActionTransChart(xData,series){
|
|||||||
}
|
}
|
||||||
series.push({
|
series.push({
|
||||||
name: entrance,
|
name: entrance,
|
||||||
data: d.count
|
data: d.result,
|
||||||
|
marker: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -42,8 +42,12 @@
|
|||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
||||||
</div>
|
</div>
|
||||||
<input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
<%-- <input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||||
value="${beginDate}" onclick="WdatePicker({onpicked:setTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/>
|
value="${beginDate}" onclick="WdatePicker({onpicked:setTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/> --%>
|
||||||
|
<input id="beginDate" name="beginDate" type="text"
|
||||||
|
readonly="readonly" class="form-control Wdate input-medium"
|
||||||
|
value=""
|
||||||
|
onclick="WdatePicker({onpicked:setTime(7),dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')||currentTime()}'});"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
@@ -52,7 +56,7 @@
|
|||||||
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
||||||
</div>
|
</div>
|
||||||
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||||
value="${endDate}" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'#F{$dp.$D(\'beginDate\',{d:7})}'});"/>
|
value="" onclick="WdatePicker({el:'endDate',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:getMaxDate(7) })"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
@@ -115,7 +119,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>
|
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>--%>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/no-data-to-display.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/no-data-to-display.js"></script>
|
||||||
<script src="${ctxStatic }/pages/scripts/jQuery.print.js"></script>
|
<script src="${ctxStatic }/pages/scripts/jQuery.print.js"></script>
|
||||||
|
|||||||
@@ -32,8 +32,10 @@
|
|||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
||||||
</div>
|
</div>
|
||||||
<input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
<input id="beginDate" name="beginDate" type="text"
|
||||||
value="" onclick="WdatePicker({onpicked:setTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/>
|
readonly="readonly" class="form-control Wdate input-medium"
|
||||||
|
value=""
|
||||||
|
onclick="WdatePicker({onpicked:setTime(7),dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')||currentTime()}'});"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
@@ -42,7 +44,7 @@
|
|||||||
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
||||||
</div>
|
</div>
|
||||||
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'#F{$dp.$D(\'beginDate\',{d:7})}'});"/>
|
value="" onclick="WdatePicker({el:'endDate',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:getMaxDate(7) })"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -92,7 +94,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>
|
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>--%>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
||||||
<script src="${ctxStatic }/pages/scripts/jQuery.print.js"></script>
|
<script src="${ctxStatic }/pages/scripts/jQuery.print.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|||||||
@@ -29,8 +29,13 @@
|
|||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
||||||
</div>
|
</div>
|
||||||
<input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
<!-- <input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||||
value="" onclick="WdatePicker({onpicked:setTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});" />
|
value="" onclick="WdatePicker({onpicked:setTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});" />
|
||||||
|
-->
|
||||||
|
<input id="beginDate" name="beginDate" type="text"
|
||||||
|
readonly="readonly" class="form-control Wdate input-medium"
|
||||||
|
value=""
|
||||||
|
onclick="WdatePicker({onpicked:setTime(7),dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')||currentTime()}'});"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
@@ -38,8 +43,11 @@
|
|||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
||||||
</div>
|
</div>
|
||||||
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
<!-- <input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'#F{$dp.$D(\'beginDate\',{d:7})}'});" />
|
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'#F{$dp.$D(\'beginDate\',{d:7})}'});" />
|
||||||
|
-->
|
||||||
|
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||||
|
value="" onclick="WdatePicker({el:'endDate',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:getMaxDate(7) })"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -107,7 +115,7 @@
|
|||||||
<script src="${ctxStatic }/global/plugins/tableExport-3.3.13/tableexport.js"></script>
|
<script src="${ctxStatic }/global/plugins/tableExport-3.3.13/tableexport.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>
|
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>--%>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
||||||
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/themes/grid.js"></script> --%>
|
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/themes/grid.js"></script> --%>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting-data.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting-data.js"></script>
|
||||||
@@ -179,9 +187,10 @@ function searchList(){
|
|||||||
|
|
||||||
function showIpActiveChart(xData,series){
|
function showIpActiveChart(xData,series){
|
||||||
var nowDate=new Date();
|
var nowDate=new Date();
|
||||||
|
Highcharts.setOptions({ global: { useUTC: false } });
|
||||||
var chart = Highcharts.chart('chart', {
|
var chart = Highcharts.chart('chart', {
|
||||||
chart:{
|
chart:{
|
||||||
//type: 'area',
|
type: 'area',
|
||||||
zoomType: 'x'
|
zoomType: 'x'
|
||||||
},
|
},
|
||||||
exporting: {
|
exporting: {
|
||||||
@@ -206,12 +215,20 @@ function showIpActiveChart(xData,series){
|
|||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
//tickInterval:tickInterval,
|
//tickInterval:tickInterval,
|
||||||
type:'category',
|
type:'datetime',
|
||||||
categories: xData,
|
dateTimeLabelFormats: {
|
||||||
|
second: '%H:%M:%S',
|
||||||
|
minute: '%H:%M',
|
||||||
|
hour: '%H:%M',
|
||||||
|
day: '%m-%d',
|
||||||
|
week: '%m-%d',
|
||||||
|
month: '%Y-%m',
|
||||||
|
year: '%Y'
|
||||||
|
},
|
||||||
title: {
|
title: {
|
||||||
text: 'time',
|
text: 'time',
|
||||||
align:'high',
|
align:'high',
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
noData:{
|
noData:{
|
||||||
style: {//设置字体颜色
|
style: {//设置字体颜色
|
||||||
@@ -266,16 +283,17 @@ function showIpActiveChart(xData,series){
|
|||||||
var xData=new Array();
|
var xData=new Array();
|
||||||
var series=new Array();
|
var series=new Array();
|
||||||
if(rs!=null&&rs.length>0){
|
if(rs!=null&&rs.length>0){
|
||||||
xData=rs[0].statTime;
|
|
||||||
$(rs).each(function(i, d) {
|
$(rs).each(function(i, d) {
|
||||||
total.push(
|
total.push(d.sum)
|
||||||
sum(d.linkNum)
|
|
||||||
)
|
|
||||||
series.push({
|
series.push({
|
||||||
name: d.ipAddr,
|
name: d.ipAddr,
|
||||||
data: d.linkNum
|
data: d.result,
|
||||||
|
marker: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
console.log(rs)
|
||||||
}else{
|
}else{
|
||||||
series.push({
|
series.push({
|
||||||
name: " ",
|
name: " ",
|
||||||
|
|||||||
@@ -28,8 +28,13 @@
|
|||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
||||||
</div>
|
</div>
|
||||||
<input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
<!-- <input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||||
value="" onclick="WdatePicker({onpicked:setTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/>
|
value="" onclick="WdatePicker({onpicked:setTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/>
|
||||||
|
-->
|
||||||
|
<input id="beginDate" name="beginDate" type="text"
|
||||||
|
readonly="readonly" class="form-control Wdate input-medium"
|
||||||
|
value=""
|
||||||
|
onclick="WdatePicker({onpicked:setTime(7),dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')||currentTime()}'});"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
@@ -37,8 +42,10 @@
|
|||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||||
|
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'#F{$dp.$D(\'beginDate\',{d:7})}'});"/> -->
|
||||||
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'#F{$dp.$D(\'beginDate\',{d:7})}'});"/>
|
value="" onclick="WdatePicker({el:'endDate',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:getMaxDate(7) })"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -57,7 +64,7 @@
|
|||||||
<script src="${ctxStatic }/global/plugins/tableExport-3.3.13/tableexport.js"></script>
|
<script src="${ctxStatic }/global/plugins/tableExport-3.3.13/tableexport.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>
|
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>--%>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
||||||
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/themes/grid.js"></script> --%>
|
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/themes/grid.js"></script> --%>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting-data.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting-data.js"></script>
|
||||||
@@ -111,9 +118,10 @@ function searchList(){
|
|||||||
|
|
||||||
function showPortActiveChart(xData,series){
|
function showPortActiveChart(xData,series){
|
||||||
var nowDate=new Date();
|
var nowDate=new Date();
|
||||||
|
Highcharts.setOptions({ global: { useUTC: false } });
|
||||||
var chart = Highcharts.chart('chart', {
|
var chart = Highcharts.chart('chart', {
|
||||||
chart:{
|
chart:{
|
||||||
// type: 'area',
|
type: 'area',
|
||||||
zoomType: 'x'
|
zoomType: 'x'
|
||||||
},
|
},
|
||||||
exporting: {
|
exporting: {
|
||||||
@@ -160,8 +168,16 @@ function showPortActiveChart(xData,series){
|
|||||||
text: null
|
text: null
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type:'category',
|
type:'datetime',
|
||||||
categories: xData,
|
dateTimeLabelFormats: {
|
||||||
|
second: '%H:%M:%S',
|
||||||
|
minute: '%H:%M',
|
||||||
|
hour: '%H:%M',
|
||||||
|
day: '%m-%d',
|
||||||
|
week: '%m-%d',
|
||||||
|
month: '%Y-%m',
|
||||||
|
year: '%Y'
|
||||||
|
},
|
||||||
title: {
|
title: {
|
||||||
text: 'time',
|
text: 'time',
|
||||||
align:'high',
|
align:'high',
|
||||||
@@ -199,14 +215,16 @@ function showPortActiveChart(xData,series){
|
|||||||
var series=new Array();
|
var series=new Array();
|
||||||
var total = [];
|
var total = [];
|
||||||
if(rs!=null&&rs.length>0){
|
if(rs!=null&&rs.length>0){
|
||||||
xData=rs[0].statTime;
|
|
||||||
$(rs).each(function(i, d) {
|
$(rs).each(function(i, d) {
|
||||||
total.push(
|
total.push(
|
||||||
sum(d.sum)
|
d.sum
|
||||||
)
|
)
|
||||||
series.push({
|
series.push({
|
||||||
name: d.port,
|
name: d.port,
|
||||||
data: d.sum
|
data: d.result,
|
||||||
|
marker: {
|
||||||
|
enabled: false
|
||||||
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -32,8 +32,10 @@
|
|||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
<span class="selectpicker form-control" ><spring:message code="begin_date"/></span>
|
||||||
</div>
|
</div>
|
||||||
<input id="beginDate" name="beginDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
<input id="beginDate" name="beginDate" type="text"
|
||||||
value="" onclick="WdatePicker({onpicked:setTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/>
|
readonly="readonly" class="form-control Wdate input-medium"
|
||||||
|
value=""
|
||||||
|
onclick="WdatePicker({onpicked:setTime(7),dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')||currentTime()}'});"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
@@ -42,7 +44,7 @@
|
|||||||
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
<span class="selectpicker form-control" ><spring:message code="end_date"/></span>
|
||||||
</div>
|
</div>
|
||||||
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||||
value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'#F{$dp.$D(\'beginDate\',{d:7})}'});"/>
|
value="" onclick="WdatePicker({el:'endDate',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:getMaxDate(7) })"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
@@ -105,7 +107,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>
|
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>--%>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/no-data-to-display.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/no-data-to-display.js"></script>
|
||||||
<script src="${ctxStatic }/pages/scripts/jQuery.print.js"></script>
|
<script src="${ctxStatic }/pages/scripts/jQuery.print.js"></script>
|
||||||
|
|||||||
@@ -46,10 +46,14 @@
|
|||||||
<span class="selectpicker form-control"><spring:message
|
<span class="selectpicker form-control"><spring:message
|
||||||
code="begin_date" /></span>
|
code="begin_date" /></span>
|
||||||
</div>
|
</div>
|
||||||
<input id="beginDate" name="beginDate" type="text"
|
<!-- <input id="beginDate" name="beginDate" type="text"
|
||||||
readonly="readonly" class="form-control" style="width:166px"
|
readonly="readonly" class="form-control" style="width:166px"
|
||||||
value=""
|
value=""
|
||||||
onclick="WdatePicker({onpicked:setTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/>
|
onclick="WdatePicker({onpicked:setTime,dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')}'});"/> -->
|
||||||
|
<input id="beginDate" name="beginDate" type="text"
|
||||||
|
readonly="readonly" class="form-control Wdate input-medium"
|
||||||
|
value=""
|
||||||
|
onclick="WdatePicker({onpicked:setTime(7),dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,maxDate:'#F{$dp.$D(\'endDate\')||currentTime()}'});"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="pull-left">
|
<div class="pull-left">
|
||||||
@@ -58,9 +62,11 @@
|
|||||||
<span class="selectpicker form-control"><spring:message
|
<span class="selectpicker form-control"><spring:message
|
||||||
code="end_date" /></span>
|
code="end_date" /></span>
|
||||||
</div>
|
</div>
|
||||||
<input id="endDate" name="endDate" type="text" readonly="readonly"
|
<!-- <input id="endDate" name="endDate" type="text" readonly="readonly"
|
||||||
class="form-control" value="" style="width:166px"
|
class="form-control" value="" style="width:166px"
|
||||||
onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'#F{$dp.$D(\'beginDate\',{d:7})}'});"/>
|
onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true,minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:'#F{$dp.$D(\'beginDate\',{d:7})}'});"/> -->
|
||||||
|
<input id="endDate" name="endDate" type="text" readonly="readonly" class="form-control Wdate input-medium"
|
||||||
|
value="" onclick="WdatePicker({el:'endDate',dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:'#F{$dp.$D(\'beginDate\')}',maxDate:getMaxDate(7) })"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -162,7 +168,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/highcharts.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/exporting.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>
|
<%-- <script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/series-label.js"></script>--%>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/offline-exporting.js"></script>
|
||||||
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/no-data-to-display.js"></script>
|
<script src="${pageContext.request.contextPath}/static/global/plugins/highcharts/js/no-data-to-display.js"></script>
|
||||||
<script src="${ctxStatic }/pages/scripts/jQuery.print.js"></script>
|
<script src="${ctxStatic }/pages/scripts/jQuery.print.js"></script>
|
||||||
|
|||||||
@@ -278,6 +278,7 @@ License: www.highcharts.com/license
|
|||||||
textKey: "downloadPNG",
|
textKey: "downloadPNG",
|
||||||
onclick: function () {
|
onclick: function () {
|
||||||
console.log(this)
|
console.log(this)
|
||||||
|
console.log(chart_main)
|
||||||
this.legend.itemStyle.color='#000000'
|
this.legend.itemStyle.color='#000000'
|
||||||
this.exportChartLocal()
|
this.exportChartLocal()
|
||||||
this.legend.itemStyle.color='#ffffff'
|
this.legend.itemStyle.color='#ffffff'
|
||||||
|
|||||||
@@ -6,13 +6,26 @@ $(function(){
|
|||||||
getTotalLog();
|
getTotalLog();
|
||||||
});
|
});
|
||||||
|
|
||||||
function setTime(){
|
/*function setTime(){
|
||||||
var chooseDate=new Date($('#beginDate').val());
|
var chooseDate=new Date($('#beginDate').val());
|
||||||
chooseDate=chooseDate.setDate(chooseDate.getDate()+7);
|
chooseDate=chooseDate.setDate(chooseDate.getDate()+7);
|
||||||
var modifyTime=new Date(chooseDate);
|
var modifyTime=new Date(chooseDate);
|
||||||
$('#endDate').val(modifyTime.getFullYear()+"-"+((modifyTime.getMonth()+1)>=10?(modifyTime.getMonth()+1):"0"+(modifyTime.getMonth()+1))+"-"+(modifyTime.getDate()>=10?modifyTime.getDate():'0'+modifyTime.getDate())+' '+(modifyTime.getHours()>=10?modifyTime.getHours():'0'+modifyTime.getHours())+':'+(modifyTime.getMinutes()>=10?modifyTime.getMinutes():'0'+modifyTime.getMinutes())+':'+(modifyTime.getSeconds()>=10?modifyTime.getSeconds():'0'+modifyTime.getSeconds()));
|
$('#endDate').val(modifyTime.getFullYear()+"-"+((modifyTime.getMonth()+1)>=10?(modifyTime.getMonth()+1):"0"+(modifyTime.getMonth()+1))+"-"+(modifyTime.getDate()>=10?modifyTime.getDate():'0'+modifyTime.getDate())+' '+(modifyTime.getHours()>=10?modifyTime.getHours():'0'+modifyTime.getHours())+':'+(modifyTime.getMinutes()>=10?modifyTime.getMinutes():'0'+modifyTime.getMinutes())+':'+(modifyTime.getSeconds()>=10?modifyTime.getSeconds():'0'+modifyTime.getSeconds()));
|
||||||
|
}*/
|
||||||
|
function setTime(dayData){
|
||||||
|
var useTime=$('#beginDate').val();
|
||||||
|
if(useTime==''){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var chooseDate=new Date(useTime);
|
||||||
|
chooseDate=chooseDate.setDate(chooseDate.getDate()+dayData);
|
||||||
|
var now =new Date();
|
||||||
|
if(now.getTime()<new Date(chooseDate).getTime()){
|
||||||
|
chooseDate=now;
|
||||||
|
}
|
||||||
|
var modifyTime=new Date(chooseDate);
|
||||||
|
$('#endDate').val(modifyTime.getFullYear()+"-"+((modifyTime.getMonth()+1)>=10?(modifyTime.getMonth()+1):"0"+(modifyTime.getMonth()+1))+"-"+(modifyTime.getDate()>=10?modifyTime.getDate():'0'+modifyTime.getDate())+' '+(modifyTime.getHours()>=10?modifyTime.getHours():'0'+modifyTime.getHours())+':'+(modifyTime.getMinutes()>=10?modifyTime.getMinutes():'0'+modifyTime.getMinutes())+':'+(modifyTime.getSeconds()>=10?modifyTime.getSeconds():'0'+modifyTime.getSeconds()));
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTimee(){
|
function setTimee(){
|
||||||
var chooseDate=new Date($('#searchFoundStartTime').val());
|
var chooseDate=new Date($('#searchFoundStartTime').val());
|
||||||
chooseDate=chooseDate.setDate(chooseDate.getDate()+1);
|
chooseDate=chooseDate.setDate(chooseDate.getDate()+1);
|
||||||
@@ -21,6 +34,68 @@ function setTimee(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function currentTime() {
|
||||||
|
var now = new Date();
|
||||||
|
|
||||||
|
var year = now.getFullYear();
|
||||||
|
var month = now.getMonth() + 1;
|
||||||
|
var day = now.getDate();
|
||||||
|
|
||||||
|
var hh = now.getHours();
|
||||||
|
var mm = now.getMinutes();
|
||||||
|
|
||||||
|
var clock = year + "-";
|
||||||
|
|
||||||
|
if (month < 10) clock += "0";
|
||||||
|
clock += month + "-";
|
||||||
|
|
||||||
|
if (day < 10) clock += "0";
|
||||||
|
clock += day + " ";
|
||||||
|
|
||||||
|
if (hh < 10) clock += "0";
|
||||||
|
clock += hh + ":";
|
||||||
|
|
||||||
|
if (mm < 10) clock += '0';
|
||||||
|
clock += mm;
|
||||||
|
return (clock);
|
||||||
|
}
|
||||||
|
function getMaxDate(day){
|
||||||
|
var clock=currentTime();
|
||||||
|
var dt;
|
||||||
|
var times=0;
|
||||||
|
dt=$("#beginDate").val();
|
||||||
|
if(dt!=''){
|
||||||
|
times =Date.parse(dt.replace(/-/g,'/'))+day*24*60*60*1000;//时间间隔为10天
|
||||||
|
|
||||||
|
if(times-Date.parse(clock.replace(/-/g,'/'))<0){
|
||||||
|
var d1 = new Date(times);
|
||||||
|
var year = d1.getFullYear();
|
||||||
|
var month = d1.getMonth() + 1; //月份以0开头
|
||||||
|
var day = d1.getDate();
|
||||||
|
|
||||||
|
var hh = d1.getHours();
|
||||||
|
var mm = d1.getMinutes();
|
||||||
|
|
||||||
|
var clock = year + "-";
|
||||||
|
|
||||||
|
if (month < 10) clock += "0";
|
||||||
|
clock += month + "-";
|
||||||
|
|
||||||
|
if (day < 10) clock += "0";
|
||||||
|
clock += day + " ";
|
||||||
|
|
||||||
|
if (hh < 10) clock += "0";
|
||||||
|
clock += hh + ":";
|
||||||
|
|
||||||
|
if (mm < 10) clock += '0';
|
||||||
|
clock += mm;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return clock;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var getTotalLog=function(){
|
var getTotalLog=function(){
|
||||||
/*
|
/*
|
||||||
td需要配置属性有,audit,functionId,compileId,action
|
td需要配置属性有,audit,functionId,compileId,action
|
||||||
|
|||||||
@@ -292,7 +292,14 @@
|
|||||||
fill: '#51586f'
|
fill: '#51586f'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
menuItems: [
|
||||||
|
Highcharts.getOptions().exporting.buttons.contextButton.menuItems[0],// 打印
|
||||||
|
Highcharts.getOptions().exporting.buttons.contextButton.menuItems[1],// jpeg
|
||||||
|
'downloadPNG','downloadPDF',
|
||||||
|
Highcharts.getOptions().exporting.buttons.contextButton.menuItems[4],// excel
|
||||||
|
Highcharts.getOptions().exporting.buttons.contextButton.menuItems[3],// cvs
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -133,9 +133,10 @@ var importCfg=function(){
|
|||||||
}
|
}
|
||||||
var appFlag=true;
|
var appFlag=true;
|
||||||
if(($("#functionId").val() == 63)||($("#functionId").val() == 408)||($("#functionId").val() == 407)||
|
if(($("#functionId").val() == 63)||($("#functionId").val() == 408)||($("#functionId").val() == 407)||
|
||||||
($("#functionId").val() == 402)||($("#functionId").val() == 403)||($("#functionId").val() == 405)){
|
($("#functionId").val() == 402)||($("#functionId").val() == 403)||($("#functionId").val() == 405)
|
||||||
|
||($("#functionId").val() == 563)||($("#functionId").val() == 565)||($("#functionId").val() == 564)||($("#functionId").val() == 566)){
|
||||||
var appIdValue=$("#appIdName").val();
|
var appIdValue=$("#appIdName").val();
|
||||||
if(appIdValue == null || appIdValue ==''){
|
if(appIdValue == null || appIdValue =='' || typeof(appIdValue) == "undefined"){
|
||||||
appFlag=false;
|
appFlag=false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user