diff --git a/src/main/java/com/nis/domain/configuration/DnsResStrategy.java b/src/main/java/com/nis/domain/configuration/DnsResStrategy.java index 6c08485d6..ba5b6e5e9 100644 --- a/src/main/java/com/nis/domain/configuration/DnsResStrategy.java +++ b/src/main/java/com/nis/domain/configuration/DnsResStrategy.java @@ -34,7 +34,21 @@ public class DnsResStrategy extends BaseCfg { private String miTtlmax; //仅作导入使用 private String ttl; + @ExcelField(title="policy_number",sort=0) + private String dnsId; + + + public String getDnsId() { + return dnsId; + } + + + public void setDnsId(String dnsId) { + this.dnsId = dnsId; + } + + public String getTtl() { return ttl; } diff --git a/src/main/java/com/nis/domain/log/DkBehaviorLog.java b/src/main/java/com/nis/domain/log/DkBehaviorLog.java index bb37a1a61..5e462981e 100644 --- a/src/main/java/com/nis/domain/log/DkBehaviorLog.java +++ b/src/main/java/com/nis/domain/log/DkBehaviorLog.java @@ -2,6 +2,7 @@ package com.nis.domain.log; import java.util.Date; +import com.nis.util.excel.ExcelField; import com.wordnik.swagger.annotations.ApiModelProperty; /** @@ -31,8 +32,32 @@ public class DkBehaviorLog extends BaseLogEntity { protected String c2sByteNum; @ApiModelProperty(value = "s2c字节数", required = true) protected String s2cByteNum; + @ExcelField(title="basic_protocol",sort=8) + protected String labelProtoName; + @ExcelField(title="behaviour_type",sort=9) + protected String labelBehavName; + @ExcelField(title="social_app",sort=10) + protected String labelAppName; + public String getLabelProtoName() { + return labelProtoName; + } + public void setLabelProtoName(String labelProtoName) { + this.labelProtoName = labelProtoName; + } + public String getLabelBehavName() { + return labelBehavName; + } + public void setLabelBehavName(String labelBehavName) { + this.labelBehavName = labelBehavName; + } + public String getLabelAppName() { + return labelAppName; + } + public void setLabelAppName(String labelAppName) { + this.labelAppName = labelAppName; + } public Integer getLabelProtoId() { return labelProtoId; } diff --git a/src/main/java/com/nis/domain/log/MmAvIpLog.java b/src/main/java/com/nis/domain/log/MmAvIpLog.java index 8e2d79d94..c504ca2c7 100644 --- a/src/main/java/com/nis/domain/log/MmAvIpLog.java +++ b/src/main/java/com/nis/domain/log/MmAvIpLog.java @@ -1,5 +1,6 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; import com.wordnik.swagger.annotations.ApiModelProperty; /** @@ -11,18 +12,25 @@ import com.wordnik.swagger.annotations.ApiModelProperty; public class MmAvIpLog extends BaseLogEntity { private static final long serialVersionUID = -6177790560553329386L; + @ExcelField(title="pid",sort=8) @ApiModelProperty(value="节目ID", required=true) protected String pid; + @ExcelField(title="access_url",sort=9) @ApiModelProperty(value="节目访问地址", required=true) protected String url; + @ExcelField(title="log_uri",sort=10) @ApiModelProperty(value="封堵现场片段路径", required=true) protected String logUri; + @ExcelField(title="referer",sort=11) @ApiModelProperty(value="入口页面", required=true) protected String referer; + @ExcelField(title="harm_level",sort=12) @ApiModelProperty(value="有害级别", required=true) protected Integer level; + @ExcelField(title="fd_type",dictType="FD_TYPE",sort=13) @ApiModelProperty(value="封堵类型", required=true) protected Integer fdType; + @ExcelField(title="av_protocol",dictType="AV_PROTOCOL",sort=14) @ApiModelProperty(value="协议", required=true) protected String protocol; public String getPid() { diff --git a/src/main/java/com/nis/domain/log/MmFileDigestLog.java b/src/main/java/com/nis/domain/log/MmFileDigestLog.java index e9c896b73..aa9146dfb 100644 --- a/src/main/java/com/nis/domain/log/MmFileDigestLog.java +++ b/src/main/java/com/nis/domain/log/MmFileDigestLog.java @@ -1,5 +1,6 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; import com.wordnik.swagger.annotations.ApiModelProperty; /** @@ -11,20 +12,22 @@ import com.wordnik.swagger.annotations.ApiModelProperty; public class MmFileDigestLog extends BaseLogEntity { private static final long serialVersionUID = -6177790560553329386L; - @ApiModelProperty(value="节目ID", required=true) - protected String pid; - @ApiModelProperty(value="节目访问地址", required=true) - protected String url; - @ApiModelProperty(value="封堵现场片段路径", required=true) - protected String logUri; - @ApiModelProperty(value="入口页面", required=true) - protected String referer; - @ApiModelProperty(value="有害级别", required=true) - protected Integer level; - @ApiModelProperty(value="封堵类型", required=true) - protected Integer fdType; - @ApiModelProperty(value="协议", required=true) - protected String protocol; + @ExcelField(title="pid",sort=8) + private String pid;// 节目ID + @ExcelField(title="access_url",sort=9) + private String url;// 节目访问地址 + @ExcelField(title="log_uri",sort=10) + private String logUri;// fd现场片段路径 + @ExcelField(title="referer",sort=11) + private String referer;// 入口页面 + @ExcelField(title="harm_level",sort=12) + private Integer level;// 有害级别 + @ExcelField(title="fd_type",dictType="FD_TYPE",sort=13) + private Integer fdType;// fd类型 + @ExcelField(title="av_protocol",dictType="AV_PROTOCOL",sort=14) + private String protocol;// 传输协议 + + public String getPid() { return pid; } diff --git a/src/main/java/com/nis/domain/log/MmSampleAudioLog.java b/src/main/java/com/nis/domain/log/MmSampleAudioLog.java index daa512652..cfb0c8eae 100644 --- a/src/main/java/com/nis/domain/log/MmSampleAudioLog.java +++ b/src/main/java/com/nis/domain/log/MmSampleAudioLog.java @@ -1,15 +1,24 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; + public class MmSampleAudioLog extends BaseLogEntity{ private static final long serialVersionUID = -9107324545841909071L; + @ExcelField(title="pid",sort=8) private String pid;// 节目ID + @ExcelField(title="access_url",sort=9) private String url;// 节目访问地址 + @ExcelField(title="log_uri",sort=10) private String logUri;// fd现场片段路径 + @ExcelField(title="referer",sort=11) private String referer;// 入口页面 + @ExcelField(title="harm_level",sort=12) private Integer level;// 有害级别 + @ExcelField(title="fd_type",dictType="FD_TYPE",sort=13) private Integer fdType;// fd类型 + @ExcelField(title="av_protocol",dictType="AV_PROTOCOL",sort=14) private String protocol;// 传输协议 public String getPid() { diff --git a/src/main/java/com/nis/domain/log/MmSamplePicLog.java b/src/main/java/com/nis/domain/log/MmSamplePicLog.java index 734200c59..0f55a7e73 100644 --- a/src/main/java/com/nis/domain/log/MmSamplePicLog.java +++ b/src/main/java/com/nis/domain/log/MmSamplePicLog.java @@ -1,16 +1,26 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; + public class MmSamplePicLog extends BaseLogEntity{ private static final long serialVersionUID = -8851111472033278357L; + @ExcelField(title="pid",sort=8) private String pid;// 节目ID + @ExcelField(title="access_url",sort=9) private String url;// 节目访问地址 + @ExcelField(title="log_uri",sort=10) private String logUri;// fd现场片段路径 + @ExcelField(title="referer",sort=11) private String referer;// 入口页面 + @ExcelField(title="harm_level",sort=12) private Integer level;// 有害级别 + @ExcelField(title="fd_type",dictType="FD_TYPE",sort=13) private Integer fdType;// fd类型 + @ExcelField(title="av_protocol",dictType="AV_PROTOCOL",sort=14) private String protocol;// 传输协议 + public String getPid() { return pid; } diff --git a/src/main/java/com/nis/domain/log/MmSampleVideoLog.java b/src/main/java/com/nis/domain/log/MmSampleVideoLog.java index 55b17cf4b..7cadf815c 100644 --- a/src/main/java/com/nis/domain/log/MmSampleVideoLog.java +++ b/src/main/java/com/nis/domain/log/MmSampleVideoLog.java @@ -1,16 +1,26 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; + public class MmSampleVideoLog extends BaseLogEntity{ private static final long serialVersionUID = -1160853324359310439L; + @ExcelField(title="pid",sort=8) private String pid;// 节目ID + @ExcelField(title="access_url",sort=9) private String url;// 节目访问地址 + @ExcelField(title="log_uri",sort=10) private String logUri;// fd现场片段路径 + @ExcelField(title="referer",sort=11) private String referer;// 入口页面 + @ExcelField(title="harm_level",sort=12) private Integer level;// 有害级别 + @ExcelField(title="fd_type",dictType="FD_TYPE",sort=13) private Integer fdType;// fd类型 + @ExcelField(title="av_protocol",dictType="AV_PROTOCOL",sort=14) private String protocol;// 传输协议 + public String getPid() { return pid; } diff --git a/src/main/java/com/nis/domain/log/MmVoipLog.java b/src/main/java/com/nis/domain/log/MmVoipLog.java index f052e1bfd..42f09527b 100644 --- a/src/main/java/com/nis/domain/log/MmVoipLog.java +++ b/src/main/java/com/nis/domain/log/MmVoipLog.java @@ -1,5 +1,6 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; import com.wordnik.swagger.annotations.ApiModelProperty; /** @@ -16,34 +17,62 @@ public class MmVoipLog extends BaseLogEntity { */ private static final long serialVersionUID = -9218072642855154505L; @ApiModelProperty(value="VOIP通话时长(秒)", required=true) + @ExcelField(title="duation",sort=8) private String duation; + @ApiModelProperty(value="VOIP协议", required=true) + @ExcelField(title="voip_protocol",sort=9) private String voipProtocol; + @ApiModelProperty(value="主叫VOIP账号", required=false) + @ExcelField(title="calling_account",sort=10) private String callingAccount; + @ApiModelProperty(value="被叫VOIP账号", required=false) + @ExcelField(title="called_account",sort=11) private String calledAccount; + @ApiModelProperty(value="VOIP主叫电信号码", required=false) + @ExcelField(title="calling_number",sort=12) private String callingNumber; + @ApiModelProperty(value="VOIP被叫电信号码", required=false) + @ExcelField(title="called_number",sort=13) private String calledNumber; + @ApiModelProperty(value="主叫VOIP语音文件存放服务器IP", required=true) + @ExcelField(title="from_to_store_ip",sort=14) private String fromToStoreIp; + @ApiModelProperty(value="主叫VOIP语音文件存放服务器URL", required=true) + @ExcelField(title="from_to_store_url",sort=15) private String fromToStoreUrl; + @ApiModelProperty(value="被叫VOIP语音文件存放服务器IP", required=true) + @ExcelField(title="to_from_store_ip",sort=16) private String toFromStoreIp; + @ApiModelProperty(value="被叫VOIP语音文件存放服务器URL", required=true) + @ExcelField(title="to_from_store_url",sort=17) private String toFromStoreUrl; + @ApiModelProperty(value="节目ID", required=true) + @ExcelField(title="pid",sort=18) private String pid; + @ApiModelProperty(value="封堵现场片段路径", required=false) + @ExcelField(title="log_uri",sort=19) private String logUri; + @ApiModelProperty(value="有害级别", required=false) + @ExcelField(title="harm_level",sort=20) private Integer level; + @ApiModelProperty(value="封堵类型", required=false) + @ExcelField(title="fd_type",sort=21) private Integer fdType; + public String getPid() { return pid; } diff --git a/src/main/java/com/nis/domain/log/NtcBGPLog.java b/src/main/java/com/nis/domain/log/NtcBGPLog.java index 64a1ac784..ed76262b5 100644 --- a/src/main/java/com/nis/domain/log/NtcBGPLog.java +++ b/src/main/java/com/nis/domain/log/NtcBGPLog.java @@ -1,28 +1,39 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; + public class NtcBGPLog extends BaseLogEntity { private static final long serialVersionUID = 4597407682545926823L; + @ExcelField(title = "message_type", sort = 78) private Integer type; + @ExcelField(title = "as", sort = 79) private String asNum; + @ExcelField(title = "route", sort = 80) private String route; + public Integer getType() { return type; } + public void setType(Integer type) { this.type = type; } + public String getAsNum() { return asNum; } + public void setAsNum(String asNum) { this.asNum = asNum; } + public String getRoute() { return route; } + public void setRoute(String route) { this.route = route; } - + } diff --git a/src/main/java/com/nis/domain/log/NtcCollectVoipLog.java b/src/main/java/com/nis/domain/log/NtcCollectVoipLog.java index 14f0e42b7..6be1641e3 100644 --- a/src/main/java/com/nis/domain/log/NtcCollectVoipLog.java +++ b/src/main/java/com/nis/domain/log/NtcCollectVoipLog.java @@ -4,6 +4,7 @@ import java.util.Date; import com.fasterxml.jackson.annotation.JsonIgnore; import com.nis.domain.BaseEntity; +import com.nis.util.excel.ExcelField; import com.wordnik.swagger.annotations.ApiModelProperty; /** @@ -19,80 +20,133 @@ public class NtcCollectVoipLog extends BaseEntity { private static final long serialVersionUID = -2189520672838652485L; @ApiModelProperty(value = "节目ID", required = true) + @ExcelField(title = "pid", sort = 8) protected String pid; @ApiModelProperty(value = "发现时间", required = true) + @ExcelField(title = "found_time", sort = 8) protected Date foundTime; + @ApiModelProperty(value = "接收时间", required = true) + @ExcelField(title = "recv_time", sort = 8) protected Date recvTime; + @ApiModelProperty(value = "处理机IP", required = true) + @ExcelField(title = "clj_ip", sort = 8) protected String capIp; + @ApiModelProperty(value = "VOIP协议", required = true) + @ExcelField(title = "voip_protocol", sort = 8) protected String voipProtocol; + @ApiModelProperty(value = "RTP服务端ip地址", required = true) + @ExcelField(title = "rtp_d_ip", sort = 8) protected String rtpDIp; + @ApiModelProperty(value = "RTP客户端ip地址", required = true) + @ExcelField(title = "rtp_s_ip", sort = 8) protected String rtpSIp; + @ApiModelProperty(value = "RTP服务端端口", required = true) + @ExcelField(title = "rtp_d_port", sort = 8) protected Integer rtpDPort; + @ApiModelProperty(value = "RTP客户端端口", required = true) + @ExcelField(title = "rtp_s_port", sort = 8) protected Integer rtpSPort; + @ApiModelProperty(value = "主叫VOIP语音文件存放服务器IP", required = true) + @ExcelField(title = "from_to_store_ip", sort = 8) protected String fromToStoreIp; + @ApiModelProperty(value = "主叫VOIP语音文件存放服务器URL", required = true) + @ExcelField(title = "from_to_store_url", sort = 8) protected String fromToStoreUrl; + @ApiModelProperty(value = "被叫VOIP语音文件存放服务器IP", required = true) + @ExcelField(title = "to_from_store_ip", sort = 8) protected String toFromStoreIp; + @ApiModelProperty(value = "被叫VOIP语音文件存放服务器URL", required = true) + @ExcelField(title = "to_from_store_url", sort = 8) protected String toFromStoreUrl; + @ApiModelProperty(value = "VOIP通话时长(秒)", required = true) + @ExcelField(title = "duation", sort = 8) protected String duation; + @ApiModelProperty(value = "SIP服务端ip地址", required = true) + @ExcelField(title = "sip_d_ip", sort = 8) protected String sipDIp; + @ApiModelProperty(value = "SIP客户端ip地址", required = true) + @ExcelField(title = "sip_s_ip", sort = 8) protected String sipSIp; + @ApiModelProperty(value = "SIP服务端端口", required = true) + @ExcelField(title = "sip_d_port", sort = 8) protected Integer sipDPort; + @ApiModelProperty(value = "SIP客户端端口", required = true) + @ExcelField(title = "sip_s_port", sort = 8) protected Integer sipSPort; + @ApiModelProperty(value = "SIP会话ID", required = true) + @ExcelField(title = "call_id", sort = 8) protected String callId; + @ApiModelProperty(value = "SIP请求URI", required = true) + @ExcelField(title = "request_uri", sort = 8) protected String requestUri; + @ApiModelProperty(value = "SIP主叫VOIP账号", required = true) + @ExcelField(title = "calling_account", sort = 8) protected String callingAccount; + @ApiModelProperty(value = "SIP被叫VOIP账号", required = true) + @ExcelField(title = "called_account", sort = 8) protected String calledAccount; + @ApiModelProperty(value = "SIP相应字段", required = true) + @ExcelField(title = "Contacts", sort = 8) protected String contacts; + @ApiModelProperty(value = "SIP相应字段", required = true) + @ExcelField(title = "Via", sort = 8) protected String via; + @ApiModelProperty(value = "SIP相应字段", required = true) + @ExcelField(title = "Route", sort = 8) protected String route; + @ApiModelProperty(value = "SIP相应字段", required = true) + @ExcelField(title = "Record Route", sort = 8) protected String recordRoute; + @ApiModelProperty(value = "SIP相应字段", required = true) + @ExcelField(title = "User Agent", sort = 8) protected String userAgent; + @ApiModelProperty(value = "SIP相应字段", required = true) + @ExcelField(title = "Server", sort = 8) protected String server; - - + protected Integer functionId; protected Integer action; - - protected String date;//配置界面日志总量查询时间 - protected String isLogTotalSearch;//由配置列表点击日志总量进行查询的标识 - protected String orderBy;//排序参数 - - protected String searchVoipProtocol;//协议类型 - protected String searchRtpDIp;//RTP服务端ip - protected String searchRtpSIp;//RTP客户端ip - protected String searchSipDIp;//SIP服务端ip - protected String searchSipSIp;//SIP客户端ip - protected String searchCapIp;//处理机IP - protected String searchFoundStartTime;//开始发现时间 - protected String searchFoundEndTime;//结束发现时间 - + + protected String date;// 配置界面日志总量查询时间 + protected String isLogTotalSearch;// 由配置列表点击日志总量进行查询的标识 + protected String orderBy;// 排序参数 + + protected String searchVoipProtocol;// 协议类型 + protected String searchRtpDIp;// RTP服务端ip + protected String searchRtpSIp;// RTP客户端ip + protected String searchSipDIp;// SIP服务端ip + protected String searchSipSIp;// SIP客户端ip + protected String searchCapIp;// 处理机IP + protected String searchFoundStartTime;// 开始发现时间 + protected String searchFoundEndTime;// 结束发现时间 + public NtcCollectVoipLog() { super(); // TODO Auto-generated constructor stub @@ -328,6 +382,7 @@ public class NtcCollectVoipLog extends BaseEntity { public void setServer(String server) { this.server = server; } + @JsonIgnore public String getSearchVoipProtocol() { return searchVoipProtocol; @@ -336,6 +391,7 @@ public class NtcCollectVoipLog extends BaseEntity { public void setSearchVoipProtocol(String searchVoipProtocol) { this.searchVoipProtocol = searchVoipProtocol; } + @JsonIgnore public String getSearchRtpDIp() { return searchRtpDIp; @@ -344,6 +400,7 @@ public class NtcCollectVoipLog extends BaseEntity { public void setSearchRtpDIp(String searchRtpDIp) { this.searchRtpDIp = searchRtpDIp; } + @JsonIgnore public String getSearchRtpSIp() { return searchRtpSIp; @@ -352,6 +409,7 @@ public class NtcCollectVoipLog extends BaseEntity { public void setSearchRtpSIp(String searchRtpSIp) { this.searchRtpSIp = searchRtpSIp; } + @JsonIgnore public String getSearchSipDIp() { return searchSipDIp; @@ -360,7 +418,7 @@ public class NtcCollectVoipLog extends BaseEntity { public void setSearchSipDIp(String searchSipDIp) { this.searchSipDIp = searchSipDIp; } - + public String getSearchSipSIp() { return searchSipSIp; } @@ -377,6 +435,7 @@ public class NtcCollectVoipLog extends BaseEntity { public void setSearchCapIp(String searchCapIp) { this.searchCapIp = searchCapIp; } + @JsonIgnore public String getSearchFoundStartTime() { return searchFoundStartTime; @@ -434,5 +493,5 @@ public class NtcCollectVoipLog extends BaseEntity { public void setOrderBy(String orderBy) { this.orderBy = orderBy; } - + } diff --git a/src/main/java/com/nis/domain/log/NtcConnRecordLog.java b/src/main/java/com/nis/domain/log/NtcConnRecordLog.java index 53076b4f7..cb292b588 100644 --- a/src/main/java/com/nis/domain/log/NtcConnRecordLog.java +++ b/src/main/java/com/nis/domain/log/NtcConnRecordLog.java @@ -1,41 +1,61 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; + public class NtcConnRecordLog extends BaseLogEntity { private static final long serialVersionUID = -4947912502754359817L; - + @ExcelField(title = "social_app", sort = 8) protected Integer appLabel; + + @ExcelField(title = "c2s_pkt_num", sort = 9) protected String c2sPktNum; + + @ExcelField(title = "s2c_pkt_num", sort = 10) protected String s2cPktNum; + + @ExcelField(title = "c2s_byte_num", sort = 12) protected String c2sByteNum; + + @ExcelField(title = "s2c_byte_num", sort = 13) protected String s2cByteNum; + public Integer getAppLabel() { return appLabel; } + public void setAppLabel(Integer appLabel) { this.appLabel = appLabel; } + public String getC2sPktNum() { return c2sPktNum; } + public void setC2sPktNum(String c2sPktNum) { this.c2sPktNum = c2sPktNum; } + public String getS2cPktNum() { return s2cPktNum; } + public void setS2cPktNum(String s2cPktNum) { this.s2cPktNum = s2cPktNum; } + public String getC2sByteNum() { return c2sByteNum; } + public void setC2sByteNum(String c2sByteNum) { this.c2sByteNum = c2sByteNum; } + public String getS2cByteNum() { return s2cByteNum; } + public void setS2cByteNum(String s2cByteNum) { this.s2cByteNum = s2cByteNum; } diff --git a/src/main/java/com/nis/domain/log/NtcDdosLog.java b/src/main/java/com/nis/domain/log/NtcDdosLog.java index 291056f7f..8ca58f826 100644 --- a/src/main/java/com/nis/domain/log/NtcDdosLog.java +++ b/src/main/java/com/nis/domain/log/NtcDdosLog.java @@ -2,6 +2,7 @@ package com.nis.domain.log; import java.util.Date; +import com.nis.util.excel.ExcelField; import com.wordnik.swagger.annotations.ApiModelProperty; public class NtcDdosLog extends BaseLogEntity { @@ -11,20 +12,28 @@ public class NtcDdosLog extends BaseLogEntity { */ private static final long serialVersionUID = 9080132009178985910L; + @ExcelField(title="attack_type",dictType="ATTACK_TYPE",sort=8) @ApiModelProperty(value = "攻击类型", required = true) protected Integer attackType; + @ExcelField(title="attack_start_time",sort=9) @ApiModelProperty(value = "攻击起始时间", required = true) protected Date attackStartTime; + @ExcelField(title="last_attack_time",sort=10) @ApiModelProperty(value = "最后一次攻击包时间", required = true) protected Date lastAttackTime; + @ExcelField(title="attack_max_pps",sort=11) @ApiModelProperty(value = "攻击最大流量, 包数/秒", required = true) protected String attackMaxPps; + @ExcelField(title="attack_max_bps",sort=12) @ApiModelProperty(value = "攻击最大流量, bit数/秒", required = true) protected String attackMaxBps; + @ExcelField(title="attack_total_pkt",sort=13) @ApiModelProperty(value = "攻击累积包数", required = true) protected String attackTotalPkt; + @ExcelField(title="attack_total_byte",sort=14) @ApiModelProperty(value = "攻击累积字节数", required = true) protected String attackTotalByte; + @ExcelField(title="is_blcok ",dictType="SYS_YES_NO",sort=15) @ApiModelProperty(value = "攻击流量是否被丢弃", required = true) protected Integer isBlock; diff --git a/src/main/java/com/nis/domain/log/NtcDnsLog.java b/src/main/java/com/nis/domain/log/NtcDnsLog.java index 9b627ae4d..050d02447 100644 --- a/src/main/java/com/nis/domain/log/NtcDnsLog.java +++ b/src/main/java/com/nis/domain/log/NtcDnsLog.java @@ -1,109 +1,157 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; + public class NtcDnsLog extends BaseLogEntity { private static final long serialVersionUID = -3763888115864065019L; + @ExcelField(title = "qr", dictType = "DNS_QR", sort = 8) private Integer qr; + + @ExcelField(title = "rd", dictType = "SYS_YES_NO", sort = 9) private Integer rd; + + @ExcelField(title = "ra", dictType = "SYS_YES_NO", sort = 10) private Integer ra; + + @ExcelField(title = "rr", sort = 11) private String rr; + + @ExcelField(title = "qtype", dictType = "DNS_QTYPE", sort = 12) private Integer qType; + + @ExcelField(title = "qclass", dictType = "DNS_QCLASS", sort = 13) private Integer qclass; + + @ExcelField(title = "opcode", dictType = "DNS_OPCODE", sort = 14) private Integer opcode; + + @ExcelField(title = "qname", sort = 15) private String qname; + + @ExcelField(title = "cname", sort = 16) private String cname; + + @ExcelField(title = "dns_sub", dictType = "DNS_SUB", sort = 17) private Integer dnsSub; - - /*以下字段无需反馈到界面*/ + + /* 以下字段无需反馈到界面 */ private String cheatType; private Integer cheatRcode; private String cheatStrategy; private String cheatRr; + public Integer getQr() { return qr; } + public void setQr(Integer qr) { this.qr = qr; } + public Integer getRd() { return rd; } + public void setRd(Integer rd) { this.rd = rd; } + public Integer getRa() { return ra; } + public void setRa(Integer ra) { this.ra = ra; } + public String getRr() { return rr; } + public void setRr(String rr) { this.rr = rr; } + public Integer getqType() { return qType; } + public void setqType(Integer qType) { this.qType = qType; } + public Integer getQclass() { return qclass; } + public void setQclass(Integer qclass) { this.qclass = qclass; } + public Integer getOpcode() { return opcode; } + public void setOpcode(Integer opcode) { this.opcode = opcode; } + public String getQname() { return qname; } + public void setQname(String qname) { this.qname = qname; } + public String getCname() { return cname; } + public void setCname(String cname) { this.cname = cname; } + public Integer getDnsSub() { return dnsSub; } + public void setDnsSub(Integer dnsSub) { this.dnsSub = dnsSub; } + public String getCheatType() { return cheatType; } + public void setCheatType(String cheatType) { this.cheatType = cheatType; } + public Integer getCheatRcode() { return cheatRcode; } + public void setCheatRcode(Integer cheatRcode) { this.cheatRcode = cheatRcode; } + public String getCheatStrategy() { return cheatStrategy; } + public void setCheatStrategy(String cheatStrategy) { this.cheatStrategy = cheatStrategy; } + public String getCheatRr() { return cheatRr; } + public void setCheatRr(String cheatRr) { this.cheatRr = cheatRr; } - - + } diff --git a/src/main/java/com/nis/domain/log/NtcFtpLog.java b/src/main/java/com/nis/domain/log/NtcFtpLog.java index f7497af9d..310916d50 100644 --- a/src/main/java/com/nis/domain/log/NtcFtpLog.java +++ b/src/main/java/com/nis/domain/log/NtcFtpLog.java @@ -1,30 +1,34 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; + public class NtcFtpLog extends BaseLogEntity { /** * */ private static final long serialVersionUID = 348767275603485504L; - - private String ftpUrl;//FTP链接 - private String ftpContent;//FTP内容 - + + @ExcelField(title = "ftp_url", sort = 8) + private String ftpUrl;// FTP链接 + + @ExcelField(title = "ftp_content", sort = 9) + private String ftpContent;// FTP内容 + public String getFtpUrl() { return ftpUrl; } + public void setFtpUrl(String ftpUrl) { this.ftpUrl = ftpUrl; } + public String getFtpContent() { return ftpContent; } + public void setFtpContent(String ftpContent) { this.ftpContent = ftpContent; } - - - - } diff --git a/src/main/java/com/nis/domain/log/NtcHttpLog.java b/src/main/java/com/nis/domain/log/NtcHttpLog.java index b7c40a447..0ba256c1f 100644 --- a/src/main/java/com/nis/domain/log/NtcHttpLog.java +++ b/src/main/java/com/nis/domain/log/NtcHttpLog.java @@ -1,22 +1,42 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; + public class NtcHttpLog extends BaseLogEntity { private static final long serialVersionUID = -7697668215327123848L; + @ExcelField(title = "URL", sort = 8) private String url; - private String reqHdrKey;//请求头转储文件key + + @ExcelField(title = "req_hdr_key", sort = 9) + private String reqHdrKey;// 请求头转储文件key + + @ExcelField(title = "req_hdr_file", sort = 10) private String reqHdrFile; - private String reqBodyKey;//请求体转储文件key + + @ExcelField(title = "req_body_key", sort = 11) + private String reqBodyKey;// 请求体转储文件key + + @ExcelField(title = "req_body_file", sort = 12) private String reqBodyFile; - private String resHdrKey;//应答头转储文件key + + @ExcelField(title = "res_hdr_key", sort = 13) + private String resHdrKey;// 应答头转储文件key + + @ExcelField(title = "res_hdr_file", sort = 14) private String resHdrFile; - private String resBodyKey;//应答体转储文件key + + @ExcelField(title = "res_body_key", sort = 15) + private String resBodyKey;// 应答体转储文件key + + @ExcelField(title = "res_body_file", sort = 16) private String resBodyFile; - private String website;//域名 - - - /*以下字段无需反馈到界面*/ + + @ExcelField(title = "website", sort = 17) + private String website;// 域名 + + /* 以下字段无需反馈到界面 */ private Integer c2sIsn; private Integer pxyFlag; private Integer httpSeq; @@ -30,143 +50,187 @@ public class NtcHttpLog extends BaseLogEntity { private String contentLen; private String contentType; private String setCookie; - - + public String getReqHdrFile() { return reqHdrFile; } + public void setReqHdrFile(String reqHdrFile) { this.reqHdrFile = reqHdrFile; } + public String getReqBodyFile() { return reqBodyFile; } + public void setReqBodyFile(String reqBodyFile) { this.reqBodyFile = reqBodyFile; } + public String getResHdrFile() { return resHdrFile; } + public void setResHdrFile(String resHdrFile) { this.resHdrFile = resHdrFile; } + public String getResBodyFile() { return resBodyFile; } + public void setResBodyFile(String resBodyFile) { this.resBodyFile = resBodyFile; } + public Integer getPxyFlag() { return pxyFlag; } + public void setPxyFlag(Integer pxyFlag) { this.pxyFlag = pxyFlag; } + public String getCookie() { return cookie; } + public void setCookie(String cookie) { this.cookie = cookie; } + public String getRefefer() { return refefer; } + public void setRefefer(String refefer) { this.refefer = refefer; } + public String getUserAgent() { return userAgent; } + public void setUserAgent(String userAgent) { this.userAgent = userAgent; } + public String getUserDefineKey() { return userDefineKey; } + public void setUserDefineKey(String userDefineKey) { this.userDefineKey = userDefineKey; } + public String getUserDefineValue() { return userDefineValue; } + public void setUserDefineValue(String userDefineValue) { this.userDefineValue = userDefineValue; } + public String getContentLen() { return contentLen; } + public void setContentLen(String contentLen) { this.contentLen = contentLen; } + public String getContentType() { return contentType; } + public void setContentType(String contentType) { this.contentType = contentType; } + public String getSetCookie() { return setCookie; } + public void setSetCookie(String setCookie) { this.setCookie = setCookie; } + public Integer getC2sIsn() { return c2sIsn; } + public void setC2sIsn(Integer c2sIsn) { this.c2sIsn = c2sIsn; } + public Integer getHttpSeq() { return httpSeq; } + public void setHttpSeq(Integer httpSeq) { this.httpSeq = httpSeq; } + public String getUrl() { return url; } + public void setUrl(String url) { this.url = url; } + public String getReqLine() { return reqLine; } + public void setReqLine(String reqLine) { this.reqLine = reqLine; } + public String getResLine() { return resLine; } + public void setResLine(String resLine) { this.resLine = resLine; } + public String getReqHdrKey() { return reqHdrKey; } + public void setReqHdrKey(String reqHdrKey) { this.reqHdrKey = reqHdrKey; } + public String getReqBodyKey() { return reqBodyKey; } + public void setReqBodyKey(String reqBodyKey) { this.reqBodyKey = reqBodyKey; } + public String getResHdrKey() { return resHdrKey; } + public void setResHdrKey(String resHdrKey) { this.resHdrKey = resHdrKey; } + public String getResBodyKey() { return resBodyKey; } + public void setResBodyKey(String resBodyKey) { this.resBodyKey = resBodyKey; } + public String getWebsite() { return website; } + public void setWebsite(String website) { this.website = website; } diff --git a/src/main/java/com/nis/domain/log/NtcKeywordsUrlLog.java b/src/main/java/com/nis/domain/log/NtcKeywordsUrlLog.java index 0ac6de1e4..550a5c4c1 100644 --- a/src/main/java/com/nis/domain/log/NtcKeywordsUrlLog.java +++ b/src/main/java/com/nis/domain/log/NtcKeywordsUrlLog.java @@ -1,22 +1,29 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; + public class NtcKeywordsUrlLog extends BaseLogEntity { private static final long serialVersionUID = -7697668215327123848L; + @ExcelField(title = "URL", sort = 8) private String url; - private String website;//域名 + + @ExcelField(title = "website", sort = 9) + private String website;// 域名 public String getUrl() { return url; } + public void setUrl(String url) { this.url = url; } - + public String getWebsite() { return website; } + public void setWebsite(String website) { this.website = website; } diff --git a/src/main/java/com/nis/domain/log/NtcMailLog.java b/src/main/java/com/nis/domain/log/NtcMailLog.java index 5495bc1b5..6959e6b30 100644 --- a/src/main/java/com/nis/domain/log/NtcMailLog.java +++ b/src/main/java/com/nis/domain/log/NtcMailLog.java @@ -1,52 +1,74 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; + public class NtcMailLog extends BaseLogEntity { private static final long serialVersionUID = -2848016592975339617L; - - private String mailProto; //邮件协议类型,不可空 SMTP/POP3/IMAP4 + @ExcelField(title = "mail_proto", sort = 8) + private String mailProto; // 邮件协议类型,不可空 SMTP/POP3/IMAP4 + + @ExcelField(title = "mail_from", sort = 9) private String mailFrom; + + @ExcelField(title = "mail_to", sort = 10) private String mailTo; + + @ExcelField(title = "subject", sort = 11) private String subject; + + @ExcelField(title = "eml_file", sort = 12) private String emlFile; + + @ExcelField(title = "eml_key", sort = 13) private String emlKey; - - + public String getEmlKey() { return emlKey; } + public void setEmlKey(String emlKey) { this.emlKey = emlKey; } + public String getMailProto() { return mailProto; } + public void setMailProto(String mailProto) { this.mailProto = mailProto; } + public String getMailFrom() { return mailFrom; } + public void setMailFrom(String mailFrom) { this.mailFrom = mailFrom; } + public String getMailTo() { return mailTo; } + public void setMailTo(String mailTo) { this.mailTo = mailTo; } + public String getSubject() { return subject; } + public void setSubject(String subject) { this.subject = subject; } + public String getEmlFile() { return emlFile; } + public void setEmlFile(String emlFile) { this.emlFile = emlFile; } - + } diff --git a/src/main/java/com/nis/domain/log/NtcP2pLog.java b/src/main/java/com/nis/domain/log/NtcP2pLog.java index 9da477f46..e3cb86abb 100644 --- a/src/main/java/com/nis/domain/log/NtcP2pLog.java +++ b/src/main/java/com/nis/domain/log/NtcP2pLog.java @@ -1,32 +1,45 @@ package com.nis.domain.log; -public class NtcP2pLog extends BaseLogEntity{ +import com.nis.util.excel.ExcelField; + +public class NtcP2pLog extends BaseLogEntity { /** * */ private static final long serialVersionUID = -826089417186930465L; + + @ExcelField(title = "p2p_proto", sort = 8) private String p2pProto; + + @ExcelField(title = "p2p_file_id", sort = 9) private String p2pFileId; + + @ExcelField(title = "p2p_keyword", sort = 10) private String p2pKeyword; - + public String getP2pProto() { return p2pProto; } + public void setP2pProto(String p2pProto) { this.p2pProto = p2pProto; } + public String getP2pFileId() { return p2pFileId; } + public void setP2pFileId(String p2pFileId) { this.p2pFileId = p2pFileId; } + public String getP2pKeyword() { return p2pKeyword; } + public void setP2pKeyword(String p2pKeyword) { this.p2pKeyword = p2pKeyword; } - + } diff --git a/src/main/java/com/nis/domain/log/NtcSslLog.java b/src/main/java/com/nis/domain/log/NtcSslLog.java index 327a3cc1a..9d4d53a0c 100644 --- a/src/main/java/com/nis/domain/log/NtcSslLog.java +++ b/src/main/java/com/nis/domain/log/NtcSslLog.java @@ -1,38 +1,50 @@ package com.nis.domain.log; -public class NtcSslLog extends BaseLogEntity{ - +import com.nis.util.excel.ExcelField; + +public class NtcSslLog extends BaseLogEntity { + private static final long serialVersionUID = 533266057780162781L; - + + @ExcelField(title = "version", sort = 8) private String version;// 版本号 - private String sni;// SNI - private String san;// SAN + @ExcelField(title = "SNI", sort = 9) + private String sni;// SNI + @ExcelField(title = "SAN", sort = 10) + private String san;// SAN + @ExcelField(title = "CN", sort = 11) private String cn;// CN - + public String getVersion() { return version; } + public void setVersion(String version) { this.version = version; } + public String getSni() { return sni; } + public void setSni(String sni) { this.sni = sni; } + public String getSan() { return san; } + public void setSan(String san) { this.san = san; } + public String getCn() { return cn; } + public void setCn(String cn) { this.cn = cn; } - -} +} diff --git a/src/main/java/com/nis/domain/log/NtcStreamMediaLog.java b/src/main/java/com/nis/domain/log/NtcStreamMediaLog.java index ad74410e7..5f59dc916 100644 --- a/src/main/java/com/nis/domain/log/NtcStreamMediaLog.java +++ b/src/main/java/com/nis/domain/log/NtcStreamMediaLog.java @@ -1,5 +1,7 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; + /** * @ClassName:NtcStreamMediaLog * @Description:TODO(这里用一句话描述这个类的作用) @@ -10,7 +12,11 @@ package com.nis.domain.log; public class NtcStreamMediaLog extends BaseLogEntity { private static final long serialVersionUID = 1446933545638550170L; + + @ExcelField(title="access_url",sort=8) protected String url; + + @ExcelField(title="stream_media_protocol",sort=9) protected String protocol; public String getUrl() { return url; diff --git a/src/main/java/com/nis/domain/log/PxyHttpLog.java b/src/main/java/com/nis/domain/log/PxyHttpLog.java index 15bbfb658..6fa37de16 100644 --- a/src/main/java/com/nis/domain/log/PxyHttpLog.java +++ b/src/main/java/com/nis/domain/log/PxyHttpLog.java @@ -1,22 +1,38 @@ package com.nis.domain.log; +import com.nis.util.excel.ExcelField; + public class PxyHttpLog extends BaseLogEntity { private static final long serialVersionUID = -3046458130302949428L; + @ExcelField(title="URL",sort=8) private String url; + @ExcelField(title="req_line",sort=9) private String reqLine; + @ExcelField(title="res_line",sort=10) private String resLine; + @ExcelField(title="cookie",sort=11) private String cookie; + @ExcelField(title="referer",sort=12) private String referer; + @ExcelField(title="user_agent",sort=13) private String userAgent; + @ExcelField(title="content_len",sort=14) private String contentLen; + @ExcelField(title="content_type",sort=15) private String contentType; + @ExcelField(title="set_cookie",sort=16) private String setCookie; + @ExcelField(title="req_header",sort=17) private String reqHeader; + @ExcelField(title="resp_header",sort=18) private String respHeader; + private String reqBody; + private String resBody; + @ExcelField(title="website",sort=19) private String website; diff --git a/src/main/java/com/nis/domain/report/NtcAsnRecord.java b/src/main/java/com/nis/domain/report/NtcAsnRecord.java new file mode 100644 index 000000000..c7aab2dc0 --- /dev/null +++ b/src/main/java/com/nis/domain/report/NtcAsnRecord.java @@ -0,0 +1,31 @@ +package com.nis.domain.report; + +import com.nis.domain.log.BaseLogEntity; +import com.nis.util.excel.ExcelField; + +public class NtcAsnRecord extends BaseLogEntity{ + + private static final long serialVersionUID = -4947912502754359817L; + + + protected String bps; + + protected String pps; + + + + public String getBps() { + return bps; + } + public void setBps(String bps) { + this.bps = bps; + } + public String getPps() { + return pps; + } + public void setPps(String pps) { + this.pps = pps; + } + + +} diff --git a/src/main/java/com/nis/domain/report/NtcIpRangeReport.java b/src/main/java/com/nis/domain/report/NtcIpRangeReport.java new file mode 100644 index 000000000..6ebffd920 --- /dev/null +++ b/src/main/java/com/nis/domain/report/NtcIpRangeReport.java @@ -0,0 +1,72 @@ +package com.nis.domain.report; + +import java.math.BigInteger; + +import com.nis.domain.log.BaseLogEntity; + +public class NtcIpRangeReport extends BaseLogEntity{ + + private static final long serialVersionUID = -4947912502754359817L; + + protected String ipStart; + protected String ipEnd; + protected BigInteger ipStartNum; + protected BigInteger ipEndNum; + protected String ipSub; + + protected String searchCountry;//国家 + protected String searchStartIp;//开始IP + protected String searchEndIp;//结束IP + + + + public String getSearchCountry() { + return searchCountry; + } + public void setSearchCountry(String searchCountry) { + this.searchCountry = searchCountry; + } + public String getSearchStartIp() { + return searchStartIp; + } + public void setSearchStartIp(String searchStartIp) { + this.searchStartIp = searchStartIp; + } + public String getSearchEndIp() { + return searchEndIp; + } + public void setSearchEndIp(String searchEndIp) { + this.searchEndIp = searchEndIp; + } + public String getIpStart() { + return ipStart; + } + public void setIpStart(String ipStart) { + this.ipStart = ipStart; + } + public String getIpEnd() { + return ipEnd; + } + public void setIpEnd(String ipEnd) { + this.ipEnd = ipEnd; + } + public BigInteger getIpStartNum() { + return ipStartNum; + } + public void setIpStartNum(BigInteger ipStartNum) { + this.ipStartNum = ipStartNum; + } + public BigInteger getIpEndNum() { + return ipEndNum; + } + public void setIpEndNum(BigInteger ipEndNum) { + this.ipEndNum = ipEndNum; + } + public String getIpSub() { + return ipSub; + } + public void setIpSub(String ipSub) { + this.ipSub = ipSub; + } + +} diff --git a/src/main/java/com/nis/domain/report/NtcURLReport.java b/src/main/java/com/nis/domain/report/NtcURLReport.java new file mode 100644 index 000000000..46fb3d5fb --- /dev/null +++ b/src/main/java/com/nis/domain/report/NtcURLReport.java @@ -0,0 +1,59 @@ +package com.nis.domain.report; + +import java.util.List; + +import com.nis.domain.log.BaseLogEntity; + +public class NtcURLReport extends BaseLogEntity{ + + private static final long serialVersionUID = -4947912502754359817L; + + + protected String url; + protected Integer urlCount; + protected List dataList; + + protected String searchReportStartTime;//开始时间 + protected String searchReportEndTime;//结束时间 + protected String searchUrl;//查询条件 url + + + public String getUrl() { + return url; + } + public String getSearchReportStartTime() { + return searchReportStartTime; + } + public void setSearchReportStartTime(String searchReportStartTime) { + this.searchReportStartTime = searchReportStartTime; + } + public String getSearchReportEndTime() { + return searchReportEndTime; + } + public void setSearchReportEndTime(String searchReportEndTime) { + this.searchReportEndTime = searchReportEndTime; + } + public String getSearchUrl() { + return searchUrl; + } + public void setSearchUrl(String searchUrl) { + this.searchUrl = searchUrl; + } + public void setUrl(String url) { + this.url = url; + } + public Integer getUrlCount() { + return urlCount; + } + public void setUrlCount(Integer urlCount) { + this.urlCount = urlCount; + } + public List getDataList() { + return dataList; + } + public void setDataList(List dataList) { + this.dataList = dataList; + } + + +} diff --git a/src/main/java/com/nis/domain/report/NtcURLReportBase.java b/src/main/java/com/nis/domain/report/NtcURLReportBase.java new file mode 100644 index 000000000..152366173 --- /dev/null +++ b/src/main/java/com/nis/domain/report/NtcURLReportBase.java @@ -0,0 +1,26 @@ +package com.nis.domain.report; + +public class NtcURLReportBase { + + private static final long serialVersionUID = -4947912502754359817L; + + + protected String ipAddr; + protected Integer sum; + + + public String getIpAddr() { + return ipAddr; + } + public void setIpAddr(String ipAddr) { + this.ipAddr = ipAddr; + } + public Integer getSum() { + return sum; + } + public void setSum(Integer sum) { + this.sum = sum; + } + + +} diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index 849841d72..bc25c1907 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -769,6 +769,9 @@ public final class Constants { public static final String NTC_COLLECT_RADIUS_LOG =Configurations.getStringProperty("ntcCollectRadiusLog",""); public static final String NTC_CONN_RECORD_LOG =Configurations.getStringProperty("ntcConnRecordLog",""); public static final String NTC_CONN_RECORD_PERCENT =Configurations.getStringProperty("ntcConnRecordPercent",""); + public static final String NTC_ASN_RECORD =Configurations.getStringProperty("ntcAsnRecord",""); + public static final String NTC_URL_REPORT =Configurations.getStringProperty("ntcURLReport",""); + public static final String NTC_IP_RANGE_REPORT =Configurations.getStringProperty("ntcIpRangeReport",""); /** * 每次最大导出条数 diff --git a/src/main/java/com/nis/util/Reflections.java b/src/main/java/com/nis/util/Reflections.java index 075420c9a..3a91b4844 100644 --- a/src/main/java/com/nis/util/Reflections.java +++ b/src/main/java/com/nis/util/Reflections.java @@ -57,6 +57,8 @@ public class Reflections { getName="sSubscribeId"; }else if(getName.equals("DSubscribeId")){ getName="dSubscribeId"; + }else if(getName.equals("QType")){ + getName="qType"; } String getterMethodName = GETTER_PREFIX + getName; object = invokeMethod(object, getterMethodName, new Class[] {}, new Object[] {}); diff --git a/src/main/java/com/nis/util/excel/ExcelCsv.java b/src/main/java/com/nis/util/excel/ExcelCsv.java index 2caf96bba..2e1747e48 100644 --- a/src/main/java/com/nis/util/excel/ExcelCsv.java +++ b/src/main/java/com/nis/util/excel/ExcelCsv.java @@ -384,6 +384,9 @@ public class ExcelCsv { String [] datas=data.split(","); for (String tag : datas) { StringBuffer sb = new StringBuffer(); + if("null".equals(tag.trim())){ + tag=null; + } if(StringUtils.isNotBlank(tag)){ // 替换值中双引号 if(tag.contains("\"")){ @@ -412,7 +415,7 @@ public class ExcelCsv { public static boolean isDate(String strDate) { Pattern pattern = Pattern .compile("^((\\d{2}(([02468][048])|([13579][26]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])))))|(\\d{2}(([02468][1235679])|([13579][01345789]))[\\-\\/\\s]?((((0?[13578])|(1[02]))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\-\\/\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\-\\/\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))(\\s(((0?[0-9])|([1-2][0-3]))\\:([0-5]?[0-9])((\\s)|(\\:([0-5]?[0-9])))))?$"); - if(strDate.length()>= 10){ + if(strDate.trim().length()>= 10){ String date=strDate.trim().substring(0, 10); Matcher m = pattern.matcher(date); if (m.matches()) { diff --git a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java index 597e3cda3..b421742ac 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java @@ -1617,20 +1617,20 @@ public class AppCfgController extends BaseController { Map> classMap=new HashMap>(); Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=appCfgService.findAppByPolicyList(ids); + }else{ + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = appCfgService.findAppPolicyList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = appCfgService.findAppPolicyList(pageInfo, entity); - for(AppPolicyCfg policy:page.getList()){ + + for(AppPolicyCfg policy:ipLists){ SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId()); if(app!=null) { policy.setSocialName(app.getSpecServiceName()); @@ -1648,7 +1648,7 @@ public class AppCfgController extends BaseController { second.setIsLeaf(1); List secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null); //遍历,找到匹配项后将行为设置进去 - for(AppPolicyCfg policy:page.getList()){ + for(AppPolicyCfg policy:ipLists){ if(policy.getBehavCode()==null) continue; for(SpecificServiceCfg secondCfg:secondList) { if(secondCfg.getSpecServiceCode()==null) continue; @@ -1678,13 +1678,13 @@ public class AppCfgController extends BaseController { noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport); List ipList=new ArrayList(); List subscribeInfoList=new ArrayList(); - for (AppPolicyCfg cfg : page.getList()) { + for (AppPolicyCfg cfg : ipLists) { AppPolicyCfg cfgIndexInfo=appCfgService.exportIpInfo(cfg); ipList.addAll(cfgIndexInfo.getIpPortList()); subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList()); } subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); dataMap.put("NTC_IP", ipList); dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); @@ -1707,21 +1707,21 @@ public class AppCfgController extends BaseController { Map> classMap=new HashMap>(); Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=appCfgService.findAppByTopicDomainList(ids); + }else{ + Page pageInfo=new Page(request, response,"r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = appCfgService.findAppTopicDomainList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = appCfgService.findAppTopicDomainList(pageInfo, entity); - for (int i = 0; i < page.getList().size(); i++) { - AppTopicDomainCfg appTop=page.getList().get(i); + + for (int i = 0; i < ipLists.size(); i++) { + AppTopicDomainCfg appTop=ipLists.get(i); appTop.setIsHex(appTop.getIsHexbin()); appTop.setIsCaseInsenstive(appTop.getIsHexbin()); } @@ -1729,7 +1729,7 @@ public class AppCfgController extends BaseController { classMap.put(entity.getMenuNameCode(), AppTopicDomainCfg.class); String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); /*}*/ this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); } catch (Exception e) { @@ -1750,21 +1750,20 @@ public class AppCfgController extends BaseController { Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=appCfgService.findAppByIpList(ids); + }else{ + Page pageInfo=new Page(request, response,"r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = appCfgService.findAppIpList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = appCfgService.findAppIpList(pageInfo, entity); - for(AppIpCfg appIp:page.getList()){ + + + for(AppIpCfg appIp:ipLists){ SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(appIp.getSpecServiceId()); appIp.setAppName(app.getSpecServiceName()); } @@ -1772,7 +1771,7 @@ public class AppCfgController extends BaseController { classMap.put(entity.getMenuNameCode(), AppIpCfg.class); String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(),ipLists); /*}*/ this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); } catch (Exception e) { @@ -1792,22 +1791,19 @@ public class AppCfgController extends BaseController { Map> classMap=new HashMap>(); Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=appCfgService.findAppByHttpList(ids); + }else{ + Page pageInfo=new Page(request, response,"r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = appCfgService.findAppHttpList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = appCfgService.findAppHttpList(pageInfo, entity); - for(AppHttpCfg http:page.getList()){ + + for(AppHttpCfg http:ipLists){ http.setIsHex(http.getIsHexbin()); http.setIsCaseInsenstive(http.getIsHexbin()); http.setCfgKeywords(Functions.replace(http.getCfgKeywords(), "***and***"," ")); @@ -1819,7 +1815,7 @@ public class AppCfgController extends BaseController { classMap.put(entity.getMenuNameCode(), AppHttpCfg.class); String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); /*}*/ this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); } catch (Exception e) { @@ -1840,21 +1836,17 @@ public class AppCfgController extends BaseController { Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists= new ArrayList(); + if(!StringUtil.isEmpty(ids)){ + ipLists=appCfgService.findAppByDomainList(ids); + }else{ + Page pageInfo=new Page(request, response,"r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = appCfgService.findAppDomainList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = appCfgService.findAppDomainList(pageInfo, entity); - for(AppDomainCfg domain:page.getList()){ + for(AppDomainCfg domain:ipLists){ domain.setIsHex(domain.getIsHexbin()); domain.setIsCaseInsenstive(domain.getIsHexbin()); SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(domain.getSpecServiceId()); @@ -1865,7 +1857,7 @@ public class AppCfgController extends BaseController { classMap.put(entity.getMenuNameCode(), AppDomainCfg.class); String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); /*}*/ this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); } catch (Exception e) { @@ -1886,21 +1878,18 @@ public class AppCfgController extends BaseController { Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); - } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); + List ipLists= new ArrayList(); + if(!StringUtil.isEmpty(ids)){ + ipLists=appCfgService.findAppBySslList(ids); + }else{ Page pageInfo=new Page(request, response,"r"); pageInfo.setPageNo(1); pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); Page page = appCfgService.findAppSslList(pageInfo, entity); - for(AppSslCertCfg ssl:page.getList()){ + ipLists=page.getList(); + } + + for(AppSslCertCfg ssl:ipLists){ ssl.setIsHex(ssl.getIsHexbin()); ssl.setIsCaseInsenstive(ssl.getIsHexbin()); ssl.setCfgKeywords(Functions.replace(ssl.getCfgKeywords(), "***and***"," ")); @@ -1911,7 +1900,7 @@ public class AppCfgController extends BaseController { classMap.put(entity.getMenuNameCode(), AppSslCertCfg.class); String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(),ipLists); /*}*/ this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); } catch (Exception e) { diff --git a/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java index 91d6726aa..265112aac 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppFeatureCfgController.java @@ -46,6 +46,7 @@ import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.NtcSubscribeIdCfg; +import com.nis.domain.configuration.PxyObjTrustedCaCert; import com.nis.domain.configuration.WebsiteDomainTopic; import com.nis.domain.maat.ToMaatResult; import com.nis.domain.maat.ToMaatResult.ResponseData; @@ -300,22 +301,19 @@ public class AppFeatureCfgController extends BaseController { Map> classMap=new HashMap>(); Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); - } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=appMultiFeatureCfgService.findAppByFeatureIndexList(ids); + }else{ Page pageInfo=new Page(request, response,"r"); pageInfo.setPageNo(1); pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); Page page = appMultiFeatureCfgService.findAppFeatureIndexList(pageInfo, entity); - for(AppFeatureIndex feature:page.getList()){ + ipLists=page.getList(); + } + + for(AppFeatureIndex feature:ipLists){ SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(feature.getSpecServiceId()); feature.setAppName(app.getSpecServiceName()); } @@ -334,7 +332,7 @@ public class AppFeatureCfgController extends BaseController { List ipList=new ArrayList(); List keywordList=new ArrayList(); List strList=new ArrayList(); - for (AppFeatureIndex cfg : page.getList()) { + for (AppFeatureIndex cfg : ipLists) { Map maps=appMultiFeatureCfgService.exportFeature(cfg); if(entity.getFunctionId()!=567){ keywordList.addAll(maps.get("APP_KEYWORDS")); @@ -343,7 +341,7 @@ public class AppFeatureCfgController extends BaseController { } ipList.addAll(maps.get("APP_IP_RANGE")); } - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); if(entity.getFunctionId()!=564 && entity.getFunctionId()!=567 ){ keywordList=replaceKeyList(keywordList); titleList.add("APP_IP_RANGE"); diff --git a/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java b/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java index a7090d75d..03f8275f5 100644 --- a/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java +++ b/src/main/java/com/nis/web/controller/configuration/BasicProtocolController.java @@ -258,20 +258,20 @@ public class BasicProtocolController extends BaseController { Map> classMap=new HashMap>(); Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=appCfgService.findAppByPolicyList(ids); + }else{ + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = appCfgService.findAppPolicyList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = appCfgService.findAppPolicyList(pageInfo, entity); - for(AppPolicyCfg policy:page.getList()){ + for(AppPolicyCfg policy:ipLists){ SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId()); if(app!=null) { policy.setAppName(app.getSpecServiceName()); @@ -298,13 +298,13 @@ public class BasicProtocolController extends BaseController { noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport); List ipList=new ArrayList(); List subscribeInfoList=new ArrayList(); - for (AppPolicyCfg cfg : page.getList()) { + for (AppPolicyCfg cfg : ipLists) { AppPolicyCfg cfgIndexInfo=appCfgService.exportIpInfo(cfg); ipList.addAll(cfgIndexInfo.getIpPortList()); subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList()); } subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); dataMap.put("NTC_IP", ipList); dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); diff --git a/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java b/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java index 42cffdc93..1144e00b4 100644 --- a/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java +++ b/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java @@ -278,20 +278,19 @@ public class EncryptedTunnelBehaviorController extends BaseController { Map> classMap=new HashMap>(); Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=appCfgService.findAppByPolicyList(ids); + }else{ + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = appCfgService.findAppPolicyList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = appCfgService.findAppPolicyList(pageInfo, entity); - for(AppPolicyCfg policy:page.getList()){ + for(AppPolicyCfg policy:ipLists){ SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId()); if(app!=null) { policy.setBehaviorName(app.getSpecServiceName()); @@ -309,7 +308,7 @@ public class EncryptedTunnelBehaviorController extends BaseController { second.setIsLeaf(1); List secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null); //遍历,找到匹配项后将行为设置进去 - for(AppPolicyCfg policy:page.getList()){ + for(AppPolicyCfg policy:ipLists){ if(policy.getBehavCode()==null) continue; for(SpecificServiceCfg secondCfg:secondList) { if(secondCfg.getSpecServiceCode()==null) continue; @@ -339,13 +338,13 @@ public class EncryptedTunnelBehaviorController extends BaseController { noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport); List ipList=new ArrayList(); List subscribeInfoList=new ArrayList(); - for (AppPolicyCfg cfg : page.getList()) { + for (AppPolicyCfg cfg : ipLists) { AppPolicyCfg cfgIndexInfo=appCfgService.exportIpInfo(cfg); ipList.addAll(cfgIndexInfo.getIpPortList()); subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList()); } subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); dataMap.put("NTC_IP", ipList); dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); diff --git a/src/main/java/com/nis/web/controller/configuration/maintenance/DnsIpCfgController.java b/src/main/java/com/nis/web/controller/configuration/maintenance/DnsIpCfgController.java index ea54f8abc..76f7e971e 100644 --- a/src/main/java/com/nis/web/controller/configuration/maintenance/DnsIpCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/maintenance/DnsIpCfgController.java @@ -24,6 +24,7 @@ import com.nis.domain.Page; import com.nis.domain.basics.PolicyGroupInfo; import com.nis.domain.basics.ServiceDictInfo; import com.nis.domain.configuration.BaseIpCfg; +import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.DnsIpCfg; import com.nis.domain.configuration.DnsResStrategy; import com.nis.domain.configuration.IpPortCfg; @@ -212,32 +213,30 @@ public class DnsIpCfgController extends BaseController { Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=dnsIpCfgService.findByPage(ids); + }else{ + Page pageInfo=new Page(request, response,"r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = dnsIpCfgService.findPage(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = dnsIpCfgService.findPage(pageInfo, entity); - for (int i = 0; i < page.getList().size(); i++) { - if(StringUtil.isEmpty(page.getList().get(i).getDnsStrategyName())){ + + for (int i = 0; i < ipLists.size(); i++) { + if(StringUtil.isEmpty(ipLists.get(i).getDnsStrategyName())){ Properties msgProp = getMsgProp(); - page.getList().get(i).setDnsStrategyName(msgProp.getProperty("default_group")); + ipLists.get(i).setDnsStrategyName(msgProp.getProperty("default_group")); } } - model.addAttribute("page", page); titleList.add(entity.getMenuNameCode()); classMap.put(entity.getMenuNameCode(), DnsIpCfg.class); String cfgIndexInfoNoExport=",whether_area_block,client_ip,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); /*}*/ this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); } catch (Exception e) { diff --git a/src/main/java/com/nis/web/controller/configuration/maintenance/DnsResStrategyController.java b/src/main/java/com/nis/web/controller/configuration/maintenance/DnsResStrategyController.java index 9746c03e6..7cf5f23a1 100644 --- a/src/main/java/com/nis/web/controller/configuration/maintenance/DnsResStrategyController.java +++ b/src/main/java/com/nis/web/controller/configuration/maintenance/DnsResStrategyController.java @@ -22,6 +22,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; import com.nis.domain.basics.PolicyGroupInfo; import com.nis.domain.configuration.AppSslCertCfg; +import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.DnsResStrategy; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.specific.SpecificServiceCfg; @@ -184,29 +185,27 @@ public class DnsResStrategyController extends BaseController { Map> classMap=new HashMap>(); Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=dnsResStrategyService.findByPage(ids); + }else{ + Page pageInfo=new Page(request, response,"r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = dnsResStrategyService.findPage(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = dnsResStrategyService.findPage(pageInfo, entity); - for (int i = 0; i < page.getList().size(); i++) { - page.getList().get(i).setMiTtlmax(String.valueOf(page.getList().get(i).getMinTtl())+"-"+String.valueOf(page.getList().get(i).getMaxTtl())); + + for (int i = 0; i < ipLists.size(); i++) { + ipLists.get(i).setMiTtlmax(String.valueOf(ipLists.get(i).getMinTtl())+"-"+String.valueOf(ipLists.get(i).getMaxTtl())); + ipLists.get(i).setDnsId( String.valueOf(ipLists.get(i).getCfgId())); } titleList.add(entity.getMenuNameCode()); classMap.put(entity.getMenuNameCode(), DnsResStrategy.class); - String cfgIndexInfoNoExport=",valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; + String cfgIndexInfoNoExport=",cfg_id,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(),ipLists); /*}*/ this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); } catch (Exception e) { diff --git a/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java b/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java index 6660224e7..9766cd83e 100644 --- a/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/manipulation/DdosCfgController.java @@ -148,7 +148,18 @@ public class DdosCfgController extends BaseController { Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=ddosCfgService.findByPage(ids); + }else{ + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = ddosCfgService.findPage(pageInfo, entity); + ipLists=page.getList(); + } /*//导出选中记录 * if(!StringUtil.isEmpty(ids)){ for(String id:ids.split(",")){ @@ -157,16 +168,12 @@ public class DdosCfgController extends BaseController { //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); }else{*/ //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = ddosCfgService.findPage(pageInfo, entity); + titleList.add(entity.getMenuNameCode()); classMap.put(entity.getMenuNameCode(), DdosIpCfg.class); String cfgIndexInfoNoExport=",do_log,client_ip,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); /*}*/ this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); } catch (Exception e) { diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java b/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java index a9b91f6ec..a2be7c3e0 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java @@ -968,29 +968,27 @@ public class AvContentController extends BaseController { Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=ipCfgService.getByIdsList(ids); + }else{ + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + if(entity.getIpPort()== null){ + entity.setIpPort(new IpPortCfg()); + } + if(entity.getAvContUrlCfgList()== null){ + entity.setAvContUrlCfg(new AvContUrlCfg());; + } + if(entity.getNtcSubscribeIdCfg()==null){ + entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg()); + } + Page page = avContentCfgService.findPage(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - if(entity.getIpPort()== null){ - entity.setIpPort(new IpPortCfg()); - } - if(entity.getAvContUrlCfgList()== null){ - entity.setAvContUrlCfg(new AvContUrlCfg());; - } - if(entity.getNtcSubscribeIdCfg()==null){ - entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg()); - } - Page page = avContentCfgService.findPage(pageInfo, entity); titleList.add(entity.getMenuNameCode()); titleList.add("NTC_UNIVERSAL_IP"); titleList.add("NTC_STREAMING_MEDIA_URL"); @@ -1021,7 +1019,7 @@ public class AvContentController extends BaseController { List ipList=new ArrayList(); List subscribeInfoList=new ArrayList(); List streamurlList=new ArrayList(); - for (CfgIndexInfo cfg : page.getList()) { + for (CfgIndexInfo cfg : ipLists) { Map maps=avContentCfgService.exportstream(cfg); ipList.addAll(maps.get("NTC_UNIVERSAL_IP")); streamurlList.addAll(maps.get("NTC_STREAMING_MEDIA_URL")); @@ -1029,7 +1027,7 @@ public class AvContentController extends BaseController { } subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); streamurlList=BaseStringCfg.replaceBaseKeyList(streamurlList); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); dataMap.put("NTC_UNIVERSAL_IP", ipList); dataMap.put("NTC_STREAMING_MEDIA_URL", streamurlList); dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); @@ -1054,28 +1052,28 @@ public class AvContentController extends BaseController { Map noExportMap=new HashMap(); - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=ipCfgService.getByIdsList(ids); + }else{ + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + if(entity.getIpPort()== null){ + entity.setIpPort(new IpPortCfg()); + } + if(entity.getVoipAccount()== null){ + entity.setVoipAccount(new AvVoipAccountCfg()); + } + if(entity.getNtcSubscribeIdCfg()==null){ + entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg()); + } + Page page = avContentCfgService.findPage(new Page(request, response,"r"), entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - if(entity.getIpPort()== null){ - entity.setIpPort(new IpPortCfg()); - } - if(entity.getVoipAccount()== null){ - entity.setVoipAccount(new AvVoipAccountCfg()); - } - if(entity.getNtcSubscribeIdCfg()==null){ - entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg()); - } - Page page = avContentCfgService.findPage(new Page(request, response,"r"), entity); + titleList.add(entity.getMenuNameCode()); titleList.add("NTC_UNIVERSAL_IP"); titleList.add("NTC_VOIP_ACCOUNT"); @@ -1106,7 +1104,7 @@ public class AvContentController extends BaseController { List ipList=new ArrayList(); List subscribeInfoList=new ArrayList(); List countlList=new ArrayList(); - for (CfgIndexInfo cfg : page.getList()) { + for (CfgIndexInfo cfg : ipLists) { Map maps=avContentCfgService.exportvoip(cfg); ipList.addAll(maps.get("NTC_UNIVERSAL_IP")); countlList.addAll(maps.get("NTC_VOIP_ACCOUNT")); @@ -1114,7 +1112,7 @@ public class AvContentController extends BaseController { } countlList=BaseStringCfg.replaceBaseKeyList(countlList); subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(),ipLists); dataMap.put("NTC_UNIVERSAL_IP", ipList); dataMap.put("NTC_VOIP_ACCOUNT", countlList); dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/BgpCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/BgpCfgController.java index 3402ff801..5d2bf2264 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/BgpCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/BgpCfgController.java @@ -195,19 +195,18 @@ public class BgpCfgController extends BaseController{ Map noExportMap=new HashMap(); - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=ipCfgService.getByIdsList(ids); + }else{ + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = bgpCfgService.getBgpList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = bgpCfgService.getBgpList(pageInfo, entity); titleList.add(entity.getMenuNameCode()); titleList.add("NTC_IP"); titleList.add("NTC_BGP_AS"); @@ -236,7 +235,7 @@ public class BgpCfgController extends BaseController{ List ipList=new ArrayList(); // List subscribeInfoList=new ArrayList(); List asInfoList=new ArrayList(); - for (CfgIndexInfo cfg : page.getList()) { + for (CfgIndexInfo cfg : ipLists) { CfgIndexInfo cfgIndexInfo=bgpCfgService.exportbgp(cfg); ipList.addAll(cfgIndexInfo.getIpPortList()); // subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList()); @@ -244,7 +243,7 @@ public class BgpCfgController extends BaseController{ } asInfoList=BaseStringCfg.replaceBaseKeyList(asInfoList); // subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); dataMap.put("NTC_IP", ipList); dataMap.put("NTC_BGP_AS", asInfoList); // dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java index ca798ead9..6a9b631d1 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java @@ -617,20 +617,19 @@ public class FileTransferCfgController extends BaseController{ Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=ipCfgService.getByIdsList(ids); + }else{ + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = fileTransferCfgService.getFtpList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = fileTransferCfgService.getFtpList(pageInfo, entity); + titleList.add(entity.getMenuNameCode()); titleList.add("NTC_UNIVERSAL_IP"); titleList.add("NTC_FTP_URL"); @@ -665,7 +664,7 @@ public class FileTransferCfgController extends BaseController{ List subscribeInfoList=new ArrayList(); List ftpkeyList=new ArrayList(); List ftpurlList=new ArrayList(); - for (CfgIndexInfo cfg : page.getList()) { + for (CfgIndexInfo cfg : ipLists) { Map maps=fileTransferCfgService.exportftp(cfg); ftpkeyList.addAll(maps.get("NTC_FTP_CONTENT")); ftpurlList.addAll(maps.get("NTC_FTP_URL")); @@ -675,7 +674,7 @@ public class FileTransferCfgController extends BaseController{ subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); ftpkeyList=BaseStringCfg.replaceBaseKeyList(ftpkeyList); ftpurlList=BaseStringCfg.replaceBaseKeyList(ftpurlList); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); dataMap.put("NTC_UNIVERSAL_IP", ipList); dataMap.put("NTC_FTP_URL", ftpurlList); dataMap.put("NTC_FTP_CONTENT", ftpkeyList); @@ -701,19 +700,19 @@ public class FileTransferCfgController extends BaseController{ Map noExportMap=new HashMap(); - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=ipCfgService.getByIdsList(ids); + }else{ + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = fileTransferCfgService.getP2pList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = fileTransferCfgService.getP2pList(pageInfo, entity); + titleList.add(entity.getMenuNameCode()); titleList.add("NTC_UNIVERSAL_IP"); @@ -753,7 +752,7 @@ public class FileTransferCfgController extends BaseController{ List subscribeInfoList=new ArrayList(); List hashList=new ArrayList(); List keywordList=new ArrayList(); - for (CfgIndexInfo cfg : page.getList()) { + for (CfgIndexInfo cfg : ipLists) { Map maps=fileTransferCfgService.exportp2p(cfg); keywordList.addAll(maps.get("NTC_P2P_KEYWORDS")); hashList.addAll(maps.get("NTC_P2P_HASH_BIN")); @@ -763,7 +762,7 @@ public class FileTransferCfgController extends BaseController{ subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); keywordList=BaseStringCfg.replaceBaseKeyList(keywordList); hashList=BaseStringCfg.replaceBaseKeyList(hashList); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); dataMap.put("NTC_UNIVERSAL_IP", ipList); dataMap.put("NTC_P2P_KEYWORDS", keywordList); dataMap.put("NTC_P2P_HASH_BIN", hashList); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java b/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java index 39cc183b9..29f557025 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java @@ -435,19 +435,18 @@ public class IpController extends BaseController{ Map noExportMap=new HashMap(); - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=ipCfgService.getByIdsList(ids); + }else{ + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = ipCfgService.getIpCfgList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = ipCfgService.getIpCfgList(pageInfo, entity); titleList.add(entity.getMenuNameCode()); titleList.add("NTC_IP"); titleList.add("asn_policy"); @@ -465,7 +464,7 @@ public class IpController extends BaseController{ noExportMap.put("asn_policy", asnGroupInfoNoExport); List ipList=new ArrayList(); List groupInfoList=new ArrayList(); - for (CfgIndexInfo cfg : page.getList()) { + for (CfgIndexInfo cfg : ipLists) { CfgIndexInfo cfgIndexInfo=ipCfgService.exportIpInfo(cfg); ipList.addAll(cfgIndexInfo.getIpPortList()); if(!StringUtil.isEmpty(cfgIndexInfo.getAsnIpGroupName())){ @@ -475,7 +474,7 @@ public class IpController extends BaseController{ groupInfoList.add(group); } } - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); dataMap.put("NTC_IP", ipList); dataMap.put("asn_policy", groupInfoList); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java index 7368b61a8..0600369d3 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java @@ -234,20 +234,19 @@ public class MailCfgController extends BaseController{ Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=ipCfgService.getByIdsList(ids); + }else{ + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = mailCfgService.getMailList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = mailCfgService.getMailList(pageInfo, entity); + titleList.add(entity.getMenuNameCode()); String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator" @@ -287,7 +286,7 @@ public class MailCfgController extends BaseController{ List subscribeInfoList=new ArrayList(); List mailBodyList=new ArrayList(); List mailReqHdrList=new ArrayList(); - for (CfgIndexInfo cfg : page.getList()) { + for (CfgIndexInfo cfg : ipLists) { Map maps=mailCfgService.exportmail(cfg); mailReqHdrList.addAll(maps.get("NTC_MAIL_HDR")); mailBodyList.addAll(maps.get("NTC_MAIL_BODY")); @@ -304,7 +303,7 @@ public class MailCfgController extends BaseController{ } } - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); dataMap.put("NTC_MAIL_HDR", mailReqHdrList); dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); /*}*/ diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java index 60e8373fd..90b7f2d2d 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java @@ -638,18 +638,19 @@ public class WebsiteController extends BaseController{ List regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId()); - /*//导出选中记录 - if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=ipCfgService.getByIdsList(ids); + }else{ + Page pageInfo=new Page(request, response,"a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ //条件导出数据大于最大导出数,只导出最大导出条数 - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity); + String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,"; String httpUrlCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator" + ",config_time,editor,edit_time,auditor,audit_time" @@ -686,7 +687,7 @@ public class WebsiteController extends BaseController{ List httpResBodyList = new ArrayList<>(); List ipPortList = new ArrayList<>(); List subscribeIdList = new ArrayList<>(); - for (CfgIndexInfo cfg : page.getList()) { + for (CfgIndexInfo cfg : ipLists) { Map maps=websiteCfgService.exportHttpCfg(cfg); httpUrlList.addAll(maps.get("NTC_HTTP_URL")); httpReqHdrList.addAll(maps.get("NTC_HTTP_REQ_HDR")); @@ -705,7 +706,7 @@ public class WebsiteController extends BaseController{ titleList.add(entity.getMenuNameCode()); classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(),ipLists); if(entity.getFunctionId()!=635){ titleList.add("NTC_HTTP_URL"); @@ -759,36 +760,35 @@ public class WebsiteController extends BaseController{ Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=ipCfgService.getByIdsList(ids); + }else{ + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = websiteCfgService.getWebsiteList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = websiteCfgService.getWebsiteList(pageInfo, entity); - for (int i = 0; i < page.getList().size(); i++) { + + for (int i = 0; i < ipLists.size(); i++) { Properties msgProp = getMsgProp(); - if(page.getList().get(i).getDnsStrategyId()!=null && page.getList().get(i).getDnsStrategyId()!=0){ - List resStrategys=dnsResStrategyService.findDnsResStrategys(page.getList().get(i).getDnsStrategyId(), 1,1); + if(ipLists.get(i).getDnsStrategyId()!=null && ipLists.get(i).getDnsStrategyId()!=0){ + List resStrategys=dnsResStrategyService.findDnsResStrategys(ipLists.get(i).getDnsStrategyId(), 1,1); if(resStrategys!=null && resStrategys.size()>0){ String msg= msgProp.getProperty(resStrategys.get(0).getCfgDesc()); if(!StringUtil.isEmpty(msg)){ - page.getList().get(i).setDnsStrategyName(msg); + ipLists.get(i).setDnsStrategyName(msg); }else{ - page.getList().get(i).setDnsStrategyName(resStrategys.get(0).getCfgDesc()); + ipLists.get(i).setDnsStrategyName(resStrategys.get(0).getCfgDesc()); } }else{ - page.getList().get(i).setDnsStrategyName(msgProp.getProperty("no_strategy")); + ipLists.get(i).setDnsStrategyName(msgProp.getProperty("no_strategy")); } }else{ - page.getList().get(i).setDnsStrategyName(msgProp.getProperty("no_strategy")); + ipLists.get(i).setDnsStrategyName(msgProp.getProperty("no_strategy")); } } titleList.add(entity.getMenuNameCode()); @@ -819,7 +819,7 @@ public class WebsiteController extends BaseController{ List ipList=new ArrayList(); List subscribeInfoList=new ArrayList(); List regionInfoList=new ArrayList(); - for (CfgIndexInfo cfg : page.getList()) { + for (CfgIndexInfo cfg : ipLists) { CfgIndexInfo cfgIndexInfo=websiteCfgService.exportdns(cfg); ipList.addAll(cfgIndexInfo.getIpPortList()); subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList()); @@ -827,7 +827,7 @@ public class WebsiteController extends BaseController{ } subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList); regionInfoList=ComplexkeywordCfg.replaceComplexKeyList(regionInfoList); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(),ipLists); dataMap.put("NTC_IP", ipList); dataMap.put("NTC_DNS_REGION", regionInfoList); dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList); @@ -854,18 +854,18 @@ public class WebsiteController extends BaseController{ List regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId()); - /*//导出选中记录 - if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=ipCfgService.getByIdsList(ids); + }else{ + Page pageInfo=new Page(request, response,"a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = websiteCfgService.getWebsiteList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = websiteCfgService.getWebsiteList(pageInfo, entity); + titleList.add(entity.getMenuNameCode()); titleList.add("NTC_UNIVERSAL_IP"); titleList.add("NTC_SSL_SNI"); @@ -903,7 +903,7 @@ public class WebsiteController extends BaseController{ List sslCnList = new ArrayList<>(); List ipPortList = new ArrayList<>(); List subscribeIdList = new ArrayList(); - for (CfgIndexInfo cfg : page.getList()) { + for (CfgIndexInfo cfg : ipLists) { Map maps=websiteCfgService.exportssl(cfg); sslSniList.addAll(maps.get("NTC_SSL_SNI")); sslSnaList.addAll(maps.get("NTC_SSL_SAN")); @@ -915,7 +915,7 @@ public class WebsiteController extends BaseController{ sslSnaList=BaseStringCfg.replaceBaseKeyList(sslSnaList); sslCnList=BaseStringCfg.replaceBaseKeyList(sslCnList); subscribeIdList=BaseStringCfg.baseHexList(subscribeIdList); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); dataMap.put("NTC_UNIVERSAL_IP", ipPortList); dataMap.put("NTC_SSL_SNI", sslSniList); dataMap.put("NTC_SSL_SAN", sslSnaList); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java b/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java index c493fe3a4..1794ef977 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java @@ -343,20 +343,18 @@ public class WhiteListController extends CommonController{ Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=ipCfgService.getByIdsList(ids); + }else{ + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = ipCfgService.getIpCfgList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = ipCfgService.getIpCfgList(pageInfo, entity); titleList.add(entity.getMenuNameCode()); titleList.add("NTC_IP"); classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); @@ -369,11 +367,11 @@ public class WhiteListController extends CommonController{ noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); noExportMap.put("NTC_IP", ipPortInfoNoExport); List ipList=new ArrayList(); - for (CfgIndexInfo cfg : page.getList()) { + for (CfgIndexInfo cfg :ipLists) { CfgIndexInfo cfgIndexInfo=ipCfgService.exportIpInfo(cfg); ipList.addAll(cfgIndexInfo.getIpPortList()); } - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); dataMap.put("NTC_IP", ipList); /*}*/ this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); @@ -394,20 +392,19 @@ public class WhiteListController extends CommonController{ Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=ipCfgService.getByIdsList(ids); + }else{ + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = domainService.getDomainList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = domainService.getDomainList(pageInfo, entity); + titleList.add(entity.getMenuNameCode()); titleList.add("NTC_HTTP_URL"); classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class); @@ -420,12 +417,12 @@ public class WhiteListController extends CommonController{ noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); noExportMap.put("NTC_HTTP_URL", httpUrlInfoNoExport); List httpurlList=new ArrayList(); - for (CfgIndexInfo cfg : page.getList()) { + for (CfgIndexInfo cfg : ipLists) { CfgIndexInfo cfgIndexInfo=domainService.exportDomainInfo(cfg); httpurlList.addAll(cfgIndexInfo.getHttpUrlList()); } httpurlList=BaseStringCfg.replaceBaseKeyList(httpurlList); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); dataMap.put("NTC_HTTP_URL", httpurlList); /*}*/ this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java b/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java index 712cc2d7a..0b722959c 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/HttpRedirectPolicyController.java @@ -292,21 +292,20 @@ public class HttpRedirectPolicyController extends BaseController{ List regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId()); - /*//导出选中记录 - if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=ipCfgService.getByIdsList(ids); + }else{ + Page pageInfo=new Page(request, response,"a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - - Page page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity); + Properties prop = getMsgProp(); - for (CfgIndexInfo str : page.getList()) { + for (CfgIndexInfo str :ipLists) { if(entity.getFunctionId()!=210 && entity.getFunctionId()!=211){ String type="RESPONSE_CODE"; if(entity.getFunctionId()==207){ @@ -377,7 +376,7 @@ public class HttpRedirectPolicyController extends BaseController{ List httpResBodyList = new ArrayList<>(); List ipPortList = new ArrayList<>(); List subscribeIdList = new ArrayList<>(); - for (CfgIndexInfo cfg : page.getList()) { + for (CfgIndexInfo cfg : ipLists) { Map maps=httpRedirectCfgService.exportHttpCfg(cfg); httpUrlList.addAll(maps.get("NTC_HTTP_URL")); httpReqHdrList.addAll(maps.get("NTC_HTTP_REQ_HDR")); @@ -402,7 +401,7 @@ public class HttpRedirectPolicyController extends BaseController{ noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport); noExportMap.put("NTC_HTTP_REQ_HDR", httpReqHeadCfgNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); dataMap.put("NTC_HTTP_URL", httpUrlList); dataMap.put("NTC_HTTP_REQ_HDR", httpReqHdrList); if(entity.getFunctionId()!=208 && entity.getFunctionId()!=211){ diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java b/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java index 017a44737..0d5f2c96a 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/InterceptController.java @@ -241,21 +241,18 @@ public class InterceptController extends CommonController{ Map noExportMap=new HashMap(); Map replaceExportMap=new HashMap(); - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=ipCfgService.getByIdsList(ids); + }else{ + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"a"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = ipCfgService.getIpCfgList(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"a"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = ipCfgService.getIpCfgList(pageInfo, entity); - //获取证书信息 List certificateList=new ArrayList(); if(entity.getFunctionId().equals(200)){ @@ -264,7 +261,7 @@ public class InterceptController extends CommonController{ if(entity.getFunctionId().equals(201)){ certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain"); } - for (CfgIndexInfo str : page.getList()) { + for (CfgIndexInfo str : ipLists) { if(!StringUtil.isEmpty(str.getUserRegion5())){ Properties prop = getMsgProp(); String cs= DictUtils.getDictLabel("INTERCEPT_DOMAIN_INTENSITY", str.getUserRegion5()); @@ -308,7 +305,7 @@ public class InterceptController extends CommonController{ List ipList=new ArrayList(); List httpUrlList=new ArrayList(); List pktBinList=new ArrayList(); - for (CfgIndexInfo cfg : page.getList()) { + for (CfgIndexInfo cfg : ipLists) { Map maps=interceptCfgService.exportIpInfo(cfg); httpUrlList.addAll(maps.get("NTC_HTTP_URL")); ipList.addAll(maps.get("PXY_INTERCEPT_IP")); @@ -316,7 +313,7 @@ public class InterceptController extends CommonController{ } pktBinList=BaseStringCfg.replaceBaseKeyList(pktBinList); httpUrlList=BaseStringCfg.baseHexList(httpUrlList); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); if(entity.getFunctionId()==212){ //IP Payload cfgIndexInfoNoExport=",do_log,log_total,policy_name,group_name,userregion4,userregion5,&userregion1:replace_zone-userregion2:replaced_content-userregion3:replace_content-"; titleList.add("PXY_INTERCEPT_IP"); diff --git a/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java b/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java index f6c952302..341fa4afb 100644 --- a/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java +++ b/src/main/java/com/nis/web/controller/configuration/proxy/PxyObjKeyringController.java @@ -39,6 +39,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.common.collect.Maps; import com.nis.domain.Page; import com.nis.domain.basics.PolicyGroupInfo; +import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.DnsResStrategy; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.PxyObjKeyring; @@ -410,29 +411,27 @@ public class PxyObjKeyringController extends BaseController { Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=pxyObjKeyringService.findByList(ids); + }else{ + entity.setTableName(IpPortCfg.getTablename()); + Page pageInfo=new Page(request, response,"r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = pxyObjKeyringService.findPage(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = pxyObjKeyringService.findPage(pageInfo, entity); - for (int i = 0; i > classMap=new HashMap>(); Map dataMap=new HashMap(); Map noExportMap=new HashMap(); - - - /*//导出选中记录 - * if(!StringUtil.isEmpty(ids)){ - for(String id:ids.split(",")){ - Long.parseLong(id); + List ipLists=new ArrayList(); + //导出选中记录 + if(!StringUtil.isEmpty(ids)){ + ipLists=pxyObjKeyringService.findByCertList(ids); + }else{ + Page pageInfo=new Page(request, response,"r"); + pageInfo.setPageNo(1); + pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); + Page page = pxyObjKeyringService.findTrustedCertPage(pageInfo, entity); + ipLists=page.getList(); } - //List list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids); - }else{*/ - //条件导出数据大于最大导出数,只导出最大导出条数 - entity.setTableName(IpPortCfg.getTablename()); - Page pageInfo=new Page(request, response,"r"); - pageInfo.setPageNo(1); - pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE); - Page page = pxyObjKeyringService.findTrustedCertPage(pageInfo, entity); - for (PxyObjTrustedCaCert cert:page.getList()) { + for (PxyObjTrustedCaCert cert:ipLists) { if(!StringUtil.isEmpty(cert.getCompileId())){ cert.setCrlFile(ConfigDictUtils.getTrustedCrlByCerId(cert.getCompileId())); } } - model.addAttribute("page", page); titleList.add(entity.getMenuNameCode()); classMap.put(entity.getMenuNameCode(), PxyObjTrustedCaCert.class); String cfgIndexInfoNoExport=",whether_area_block,block_type,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,&config_describe:cert_name-"; noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport); - dataMap.put(entity.getMenuNameCode(), page.getList()); + dataMap.put(entity.getMenuNameCode(), ipLists); /*}*/ this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap); } catch (Exception e) { diff --git a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java index 51d1f6e68..198e86e75 100644 --- a/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java +++ b/src/main/java/com/nis/web/controller/dashboard/TrafficStatisticsInfoController.java @@ -1,12 +1,15 @@ package com.nis.web.controller.dashboard; import java.lang.reflect.Type; +import java.math.BigDecimal; import java.net.URISyntaxException; import java.net.URLEncoder; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Calendar; +import java.util.Collections; +import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -35,10 +38,13 @@ import com.google.gson.JsonParseException; import com.google.gson.LongSerializationPolicy; import com.google.gson.reflect.TypeToken; import com.nis.domain.PageLog; +import com.nis.domain.SysDataDictionaryItem; +import com.nis.domain.configuration.WebsiteDomainTopic; import com.nis.domain.dashboard.TrafficIpActiveStatistic; import com.nis.util.CodeDicUtils; import com.nis.util.Constants; import com.nis.util.DateUtil; +import com.nis.util.DictUtils; import com.nis.util.StringUtil; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; @@ -382,4 +388,100 @@ public class TrafficStatisticsInfoController extends BaseController { } return list; } + /** + * 网址类型列表 + */ + @RequestMapping("webTypeList") + public String webTypeList(Model model){ + Calendar cal = Calendar. getInstance (); + cal.setTime(new Date()); + String now = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());//获取到完整的时间 + cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1); + String oneHoursAgo = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime()); + model.addAttribute("beginDate", oneHoursAgo); + model.addAttribute("endDate", now); + return "/dashboard/trafficWebTypeList"; + } + /** + * 网站统计图跟表 + */ + @RequestMapping(value="websiteList") + @ResponseBody + public List websiteList(Model model,@RequestParam(required=false)String beginDate,@RequestParam(required=false)String endDate){ + Map fromJsonList = new HashMap(); + List list = new ArrayList(); + String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_WEBSITELIST; +// String url = "http://192.168.11.87:8088/galaxy-service/service/log/v1/"+Constants.TRAFFIC_WEBSITELIST; + try { + url=urlAddDate(url,beginDate,endDate); + String string = HttpClientUtil.get(url); + Gson gson = new GsonBuilder().create(); + fromJsonList = gson.fromJson(string, new TypeToken(){}.getType()); + logger.debug("website接口数据"+fromJsonList); + list = (ArrayList) fromJsonList.get("data"); + BigDecimal divisor=new BigDecimal(1024*1024*1024); + DecimalFormat df = new DecimalFormat("0.00"); + DecimalFormat dl = new DecimalFormat("0"); + DecimalFormat pf = new DecimalFormat("0.00%"); + Double totalLink=0d; + Double totalGbyte=0d; + Double totalPackets=0d; + for (Object object : list) { + Map m=(Map)object; + Double count=(Double)m.get("count"); + totalGbyte+=count; + totalLink+=(Double)m.get("linkNum"); + totalPackets+=(Double)m.get("packets"); + String format = df.format(count/1024/1024/1024); + m.put("Gbyte", format); + } + List codeList = appCfgService.getDomainDict(new WebsiteDomainTopic()); + Map map = new HashMap(); + for (WebsiteDomainTopic websiteDomainTopic : codeList) { + if(!map.containsKey(websiteDomainTopic.getWebsiteServiceId())){ + map.put(websiteDomainTopic.getId(),websiteDomainTopic.getDomain()); + } + } + for (Object object : list) { + Map m=(Map)object; + Double perLink = ((Double)m.get("linkNum"))/totalLink; + m.put("perLink",pf.format(perLink)); + Double perPackets = ((Double)m.get("packets"))/totalPackets; + m.put("perPackets", pf.format(perPackets)); + Double perGbyte = ((Double)m.get("count"))/totalGbyte; + m.put("perGbyte", pf.format(perGbyte)); + if(map.containsKey(Long.parseLong(dl.format(m.get("webId"))))){ + m.put("website", map.get(Long.parseLong(dl.format(m.get("webId"))))); + } + } + Collections.sort(list, new Comparator() { + + @Override + public int compare(Object o1, Object o2) { + if(o1==null&&o2!=null){ + return 1; + } + if(o1!=null&&o2==null){ + return -1; + } + if(o1==null&&o2==null){ + return 0; + } + Map m1=(Map)o1; + Map m2=(Map)o2; + if((Double)m1.get("count")==(Double)m2.get("count")){ + return 0; + } + int result=((Double)m1.get("count")-(Double)m2.get("count"))>0?-1:1; + return result; + } + }); + } catch (Exception e) { + e.printStackTrace(); + logger.error("网站域名数据获取错误"+e); + list.add(Maps.newHashMap("error","request_service_failed")); + } + return list; + } + } diff --git a/src/main/java/com/nis/web/controller/log/manipulation/DkBehaviorLogController.java b/src/main/java/com/nis/web/controller/log/manipulation/DkBehaviorLogController.java index b0648a6d3..69febc59a 100644 --- a/src/main/java/com/nis/web/controller/log/manipulation/DkBehaviorLogController.java +++ b/src/main/java/com/nis/web/controller/log/manipulation/DkBehaviorLogController.java @@ -1,19 +1,23 @@ package com.nis.web.controller.log.manipulation; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Properties; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang3.StringUtils; import org.apache.http.client.ClientProtocolException; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -21,8 +25,8 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.log.DkBehaviorLog; -import com.nis.domain.log.NtcHttpLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.CodeDicUtils; import com.nis.util.Constants; @@ -31,6 +35,7 @@ import com.nis.util.StringUtil; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; import com.nis.web.dao.dashboard.codedic.CodeResult; +import com.nis.web.security.UserUtils; @Controller @RequestMapping(value = "${adminPath}/log/manipulation/dkbehaviorLogs") @@ -101,5 +106,110 @@ public class DkBehaviorLogController extends BaseController{ return "/log/manipulation/dkBehaviorList"; } + // Stream配置导出 + @RequestMapping(value = "exportStream") + public void exportStream(@ModelAttribute("log") DkBehaviorLog entry, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + String name= "Stream"; + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + Map params=new HashMap<>(); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + if(StringUtil.isEmpty(entry.getAction())){ + for(int i=0;i protocolList=CodeDicUtils.getCodeList("protocolCode"); + List behaviorList=CodeDicUtils.getCodeList("behaviorCode"); + List appList=CodeDicUtils.getCodeList("appCode"); + String url = ""; + url = Constants.LOG_BASE_URL+Constants.NTC_DKBEHAVIOR_LOG; + String jsonString = HttpClientUtil.getMsg(url,params,request); + + Gson gson = new GsonBuilder().create(); + //gson泛型支持 + LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>(){}.getType()); + List list=new ArrayList(); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + for (DkBehaviorLog l : list) { + l.setFunctionId(entry.getFunctionId()); + setLogAction(l, serviceList); + if(l.getLabelProtoId()!=null){ + l.setLabelProtoName(getName(l.getLabelProtoId(),protocolList)); + } + if(l.getLabelBehavId()!=null){ + l.setLabelBehavName(getName(l.getLabelBehavId(),behaviorList)); + } + if(l.getLabelAppId()!=null){ + l.setLabelAppName(getName(l.getLabelAppId(),appList)); + } + } + if(entry.getFunctionId()==407){ + hColumns+=",behaviour_type,"; + name="protocol_identify"; + }else if(entry.getFunctionId()==63){ + name="social_app_control"; + }else if(entry.getFunctionId()==408){ + name="encrypted_tunnel_behavior"; + } + titleList.add(name); + classMap.put(name, DkBehaviorLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = "," + hColumns; + noExportMap.put(name, cfgIndexInfoNoExport); + dataMap.put(name, list); + + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, name, titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, name, titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error(name +" export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } + + public String getName(Integer id,List list){ + String name=""; + Properties msgProp = getMsgProp(); + for (int i = 0; i < list.size(); i++) { + if(String.valueOf(id).equals(list.get(i).getCode())){ + name=msgProp.getProperty(list.get(i).getItem(),list.get(i).getItem()); + break; + } + } + return name; + } } diff --git a/src/main/java/com/nis/web/controller/log/ntc/BgpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/BgpLogController.java index d66b07bed..eb0125fa9 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/BgpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/BgpLogController.java @@ -1,5 +1,6 @@ package com.nis.web.controller.log.ntc; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -13,6 +14,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -20,20 +22,24 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.log.NtcAppLog; import com.nis.domain.log.NtcBGPLog; +import com.nis.domain.log.NtcCollectRadiusLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping("${adminPath}/log/ntc/other/bgpLogs") public class BgpLogController extends BaseController { - - @RequestMapping(value = {"list", ""}) - public String list(@ModelAttribute("log") NtcBGPLog log, Model model, HttpServletRequest request, HttpServletResponse response) { + + @RequestMapping(value = { "list", "" }) + public String list(@ModelAttribute("log") NtcBGPLog log, Model model, HttpServletRequest request, + HttpServletResponse response) { try { PageLog page = new PageLog(request, response); Map params = new HashMap(); @@ -43,22 +49,23 @@ public class BgpLogController extends BaseController { List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); model.addAttribute("serviceList", serviceList); - + String url = Constants.LOG_BASE_URL + Constants.NTC_BGP_LOG; String recv = HttpClientUtil.getMsg(url, params, request); - + if (StringUtils.isNotBlank(recv)) { Gson gson = new GsonBuilder().create(); - LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); if (fromJson.getStatus().intValue() == 200) { - Page data=fromJson.getData(); + Page data = fromJson.getData(); page.setCount(data.getCount()); page.setLast(data.getLast()); page.setList(data.getList()); List list = page.getList(); for (NtcBGPLog l : list) { l.setFunctionId(log.getFunctionId()); - setLogAction(l,serviceList); + setLogAction(l, serviceList); } model.addAttribute("page", page); } @@ -67,8 +74,67 @@ public class BgpLogController extends BaseController { logger.error("查询失败", e); addMessageLog(model, e.getMessage()); } - + return "/log/ntc/bgpList"; } - + + // radius配置导出 + @RequestMapping(value = "exportBgp") + public void exportBgp(@ModelAttribute("log") NtcBGPLog log, Model model, String hColumns, String types, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + System.out.println("进来了bgp"); + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_BGP_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + titleList.add("bgp_control"); + classMap.put("bgp_control", NtcBGPLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = "," + hColumns; + noExportMap.put("bgp_control", cfgIndexInfoNoExport); + dataMap.put("bgp_control", list); + /* } */ + if ("csv".equals(types)) { + this._exportCsv(model, request, response, redirectAttributes, "bgp_control", titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "bgp_control", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("bgp_control export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } } diff --git a/src/main/java/com/nis/web/controller/log/ntc/CollectVoipLogController.java b/src/main/java/com/nis/web/controller/log/ntc/CollectVoipLogController.java index d311a3784..9829ac4f8 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/CollectVoipLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/CollectVoipLogController.java @@ -1,6 +1,7 @@ package com.nis.web.controller.log.ntc; import java.io.IOException; +import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashMap; @@ -17,6 +18,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -28,7 +30,11 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.log.NtcBGPLog; +import com.nis.domain.log.NtcCollectRadiusLog; +import com.nis.domain.log.NtcCollectVoipLog; +import com.nis.domain.log.NtcCollectVoipLog; import com.nis.domain.log.NtcCollectVoipLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.CodeDicUtils; @@ -38,13 +44,15 @@ import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; import com.nis.web.dao.dashboard.codedic.CodeResult; +import com.nis.web.security.UserUtils; @Controller @RequestMapping(value = "${adminPath}/log/ntc/ntcCollectVoipLogs") -public class CollectVoipLogController extends BaseController{ +public class CollectVoipLogController extends BaseController { /** * voip泛收日志 + * * @param model * @param entry * @param request @@ -53,16 +61,17 @@ public class CollectVoipLogController extends BaseController{ * @throws ClientProtocolException * @throws IOException */ - @RequestMapping(value={"list",""}) - public String list(Model model,@ModelAttribute("log")NtcCollectVoipLog entry,HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException { - + @RequestMapping(value = { "list", "" }) + public String list(Model model, @ModelAttribute("log") NtcCollectVoipLog entry, HttpServletRequest request, + HttpServletResponse response) throws ClientProtocolException, IOException { + try { - + PageLog page = new PageLog(request, response); - Map params=new HashMap<>(); + Map params = new HashMap<>(); params.put("pageSize", page.getPageSize()); params.put("pageNo", page.getPageNo()); - //查询值判断 + // 查询值判断 if (StringUtils.isNotBlank(entry.getSearchFoundStartTime()) && StringUtils.isNotBlank(entry.getSearchFoundEndTime())) { params.put("searchFoundStartTime", entry.getSearchFoundStartTime()); @@ -118,19 +127,19 @@ public class CollectVoipLogController extends BaseController{ } List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); model.addAttribute("serviceList", serviceList); - - //获取字典信息 - List protocolList=CodeDicUtils.getCodeList("protocolCode"); - List behaviorList=CodeDicUtils.getCodeList("behaviorCode"); - List appList=CodeDicUtils.getCodeList("appCode"); + + // 获取字典信息 + List protocolList = CodeDicUtils.getCodeList("protocolCode"); + List behaviorList = CodeDicUtils.getCodeList("behaviorCode"); + List appList = CodeDicUtils.getCodeList("appCode"); model.addAttribute("protocolList", protocolList); model.addAttribute("behaviorList", behaviorList); model.addAttribute("appList", appList); - + String url = ""; - url = Constants.LOG_BASE_URL+Constants.NTC_COLLECT_VOIP_LOG; - String jsonString = HttpClientUtil.getMsg(url,params,request); - + url = Constants.LOG_BASE_URL + Constants.NTC_COLLECT_VOIP_LOG; + String jsonString = HttpClientUtil.getMsg(url, params, request); + GsonBuilder builder = new GsonBuilder(); builder.registerTypeAdapter(Date.class, new JsonDeserializer() { @@ -140,9 +149,11 @@ public class CollectVoipLogController extends BaseController{ } }); Gson gson = builder.setDateFormat("yyyy-MM-dd HH:mm:ss").create(); - //gson泛型支持 - LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>(){}.getType()); - + // gson泛型支持 + LogRecvData fromJson = gson.fromJson(jsonString, + new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { Page data = fromJson.getData(); page.setCount(data.getCount()); @@ -157,5 +168,147 @@ public class CollectVoipLogController extends BaseController{ } return "/log/ntc/collectVoipList"; } - + + // VoipCollect配置导出 + @RequestMapping(value = "exportVoipCollect") + public void exportVoipCollect(@ModelAttribute("log") NtcCollectVoipLog entry, Model model, String hColumns, + String type, HttpServletRequest request, HttpServletResponse response, + RedirectAttributes redirectAttributes) { + try { + PageLog page = new PageLog(request, response); + Map params = new HashMap<>(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + // 查询值判断 + List list = new ArrayList(); + if (StringUtils.isNotBlank(entry.getSearchFoundStartTime()) + && StringUtils.isNotBlank(entry.getSearchFoundEndTime())) { + params.put("searchFoundStartTime", entry.getSearchFoundStartTime()); + params.put("searchFoundEndTime", entry.getSearchFoundEndTime()); + } else { + // 判断是否是从配置界面过来的日志查询 + if (StringUtils.isNotBlank(entry.getIsLogTotalSearch())) { + Calendar time = Calendar.getInstance(); + time.add(Calendar.MINUTE, -5); + String searchEndTime = DateUtils.formatDateTime(time.getTime()); + params.put("searchFoundEndTime", searchEndTime); + entry.setSearchFoundEndTime(searchEndTime); + + time.add(Calendar.MINUTE, -5); + String searchStartTime = DateUtils.formatDateTime(time.getTime()); + params.put("searchFoundStartTime", searchStartTime); + entry.setSearchFoundStartTime(searchStartTime); + + } else { + // 设置默认查询当前时间及前五分钟 + String endTime = DateUtils.getDateTime(); + Date dateStart = new Date(new Date().getTime() - Constants.LOG_TIME_INTERVAL); + String startTime = DateUtils.formatDateTime(dateStart); + params.put("searchFoundStartTime", startTime); + params.put("searchFoundEndTime", endTime); + entry.setSearchFoundStartTime(startTime); + entry.setSearchFoundEndTime(endTime); + } + logger.info("searchFoundStartTime:" + params.get("searchFoundStartTime")); + logger.info("searchFoundEndTime:" + params.get("searchFoundEndTime")); + } + + if (StringUtils.isNotBlank(entry.getVoipProtocol())) { + params.put("searchVoipProtocol", entry.getVoipProtocol()); + } + if (StringUtils.isNotBlank(entry.getRtpDIp())) { + params.put("searchRtpDIp", entry.getRtpDIp()); + } + if (StringUtils.isNotBlank(entry.getCapIp())) { + params.put("searchCapIp", entry.getCapIp()); + } + if (StringUtils.isNotBlank(entry.getRtpSIp())) { + params.put("searchRtpSIp", entry.getRtpSIp()); + } + if (StringUtils.isNotBlank(entry.getSipDIp())) { + params.put("searchSipDIp", entry.getSipDIp()); + } + if (StringUtils.isNotBlank(entry.getSipSIp())) { + params.put("searchSipSIp", entry.getSipSIp()); + } + if (StringUtils.isNotBlank(entry.getOrderBy())) { + params.put("orderBy", entry.getOrderBy()); + } + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = ""; + url = Constants.LOG_BASE_URL + Constants.NTC_COLLECT_VOIP_LOG; + String jsonString = HttpClientUtil.getMsg(url, params, request); + + GsonBuilder builder = new GsonBuilder(); + builder.registerTypeAdapter(Date.class, new JsonDeserializer() { + + public Date deserialize(JsonElement json, java.lang.reflect.Type typeOfT, + JsonDeserializationContext context) throws JsonParseException { + return new Date(json.getAsJsonPrimitive().getAsLong()); + } + }); + Gson gson = builder.setDateFormat("yyyy-MM-dd HH:mm:ss").create(); + // gson泛型支持 + LogRecvData fromJson = gson.fromJson(jsonString, + new TypeToken>() { + }.getType()); + + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); +// list = getList(); + } + + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + titleList.add("collect_voip"); + classMap.put("collect_voip", NtcCollectVoipLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = ",cfg_id,action," + hColumns; + noExportMap.put("collect_voip", cfgIndexInfoNoExport); + dataMap.put("collect_voip", list); + /* } */ + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "collect_voip", titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "collect_voip", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("collect_voip export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } + + public List getList() { + List list = new ArrayList(); + for (int i = 0; i < 100; i++) { + NtcCollectVoipLog ntcCollectVoipLog = new NtcCollectVoipLog(); + ntcCollectVoipLog.setAction(i); + ntcCollectVoipLog.setCalledAccount("-" + i); + ntcCollectVoipLog.setCallId("11" + i); + ntcCollectVoipLog.setDate(new Date().toString()); + ntcCollectVoipLog.setId(1L); + ntcCollectVoipLog.setSearchRtpDIp("123"); + ntcCollectVoipLog.setCallId("199199"); + ntcCollectVoipLog.setAction(1); + ntcCollectVoipLog.setCapIp("11"); + ntcCollectVoipLog.setContacts("aa"); + ntcCollectVoipLog.setFromToStoreUrl("tocal"); + list.add(ntcCollectVoipLog); + } + return list; + } + } diff --git a/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java b/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java index 010daca01..6eb1cffa9 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/DdosLogController.java @@ -1,6 +1,7 @@ package com.nis.web.controller.log.ntc; import java.io.IOException; +import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -15,6 +16,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -26,13 +28,16 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.log.NtcCollectVoipLog; import com.nis.domain.log.NtcDdosLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; +import com.nis.util.StringUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping(value = "${adminPath}/log/ntc/ntcDdosLogs") @@ -104,4 +109,69 @@ public class DdosLogController extends BaseController{ return "/log/ntc/ddosList"; } + + // Ddos配置导出 + @RequestMapping(value = "exportDdos") + public void exportDdos(@ModelAttribute("log") NtcDdosLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + System.out.print(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_DDOS_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (NtcDdosLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + titleList.add("target_ip_protect"); + classMap.put("target_ip_protect", NtcDdosLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = "," + hColumns; + noExportMap.put("target_ip_protect", cfgIndexInfoNoExport); + dataMap.put("target_ip_protect", list); + + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "target_ip_protect", titleList, classMap, dataMap, + noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "target_ip_protect", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("DDOS export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } + } diff --git a/src/main/java/com/nis/web/controller/log/ntc/DnsLogController.java b/src/main/java/com/nis/web/controller/log/ntc/DnsLogController.java index 697263600..e58745d36 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/DnsLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/DnsLogController.java @@ -1,5 +1,6 @@ package com.nis.web.controller.log.ntc; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -13,6 +14,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -21,20 +23,23 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; -import com.nis.domain.log.NtcDdosLog; +import com.nis.domain.SysUser; +import com.nis.domain.log.NtcCollectRadiusLog; import com.nis.domain.log.NtcDnsLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping("${adminPath}/log/ntc/dns") public class DnsLogController extends BaseController { - + @RequestMapping("list") - public String list(@ModelAttribute("log") NtcDnsLog log, Model model, HttpServletRequest request, HttpServletResponse response) { + public String list(@ModelAttribute("log") NtcDnsLog log, Model model, HttpServletRequest request, + HttpServletResponse response) { try { PageLog page = new PageLog(request, response); Map params = new HashMap(); @@ -44,16 +49,17 @@ public class DnsLogController extends BaseController { params.put("searchQname", log.getQname()); } initLogSearchValue(log, params); - + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); model.addAttribute("serviceList", serviceList); - + String url = Constants.LOG_BASE_URL + Constants.NTC_DNS_LOG; String recv = HttpClientUtil.getMsg(url, params, request); - + Gson gson = new GsonBuilder().create(); - - LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); if (fromJson.getStatus().intValue() == 200) { Page data = fromJson.getData(); page.setCount(data.getCount()); @@ -62,7 +68,7 @@ public class DnsLogController extends BaseController { List list = page.getList(); for (NtcDnsLog l : list) { l.setFunctionId(log.getFunctionId()); - setLogAction(l,serviceList); + setLogAction(l, serviceList); } model.addAttribute("page", page); } @@ -70,7 +76,71 @@ public class DnsLogController extends BaseController { logger.error("查询失败", e); addMessageLog(model, e.getMessage()); } - + return "/log/ntc/dnsList"; } + + // Dns配置导出 + @RequestMapping(value = "exportDns") + public void exportDns(@ModelAttribute("log") NtcDnsLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + System.out.println("进来了dns"); + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_DNS_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (NtcDnsLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + titleList.add("DNS"); + classMap.put("DNS", NtcDnsLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = "," + hColumns; + noExportMap.put("DNS", cfgIndexInfoNoExport); + dataMap.put("DNS", list); + /* } */ + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "DNS", titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "DNS", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("DNS export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } } diff --git a/src/main/java/com/nis/web/controller/log/ntc/FtpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/FtpLogController.java index f7339d512..533f495a3 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/FtpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/FtpLogController.java @@ -1,6 +1,7 @@ package com.nis.web.controller.log.ntc; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -8,12 +9,14 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang3.StringUtils; import org.apache.http.client.ClientProtocolException; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -21,18 +24,21 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.log.NtcDnsLog; import com.nis.domain.log.NtcFtpLog; +import com.nis.domain.log.NtcFtpLog; import com.nis.domain.log.NtcOpenVpnLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping(value = "${adminPath}/log/ntc/NtcFtpLogs") -public class FtpLogController extends BaseController{ +public class FtpLogController extends BaseController { /** * @param model @@ -43,29 +49,31 @@ public class FtpLogController extends BaseController{ * @throws ClientProtocolException * @throws IOException */ - @RequestMapping(value={"list",""}) - public String list(Model model,@ModelAttribute("log")NtcFtpLog entry,HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException { - + @RequestMapping(value = { "list", "" }) + public String list(Model model, @ModelAttribute("log") NtcFtpLog entry, HttpServletRequest request, + HttpServletResponse response) throws ClientProtocolException, IOException { + try { - + PageLog page = new PageLog(request, response); - Map params=new HashMap<>(); + Map params = new HashMap<>(); params.put("pageSize", page.getPageSize()); params.put("pageNo", page.getPageNo()); - //查询值判断 - initLogSearchValue(entry,params); - + // 查询值判断 + initLogSearchValue(entry, params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); model.addAttribute("serviceList", serviceList); - + String url = ""; - url = Constants.LOG_BASE_URL+Constants.NTC_FTP_LOG; - String jsonString = HttpClientUtil.getMsg(url,params,request); - + url = Constants.LOG_BASE_URL + Constants.NTC_FTP_LOG; + String jsonString = HttpClientUtil.getMsg(url, params, request); + Gson gson = new GsonBuilder().create(); - //gson泛型支持 - LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>(){}.getType()); - + // gson泛型支持 + LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { Page data = fromJson.getData(); page.setCount(data.getCount()); @@ -74,7 +82,7 @@ public class FtpLogController extends BaseController{ List list = page.getList(); for (NtcFtpLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l,serviceList); + setLogAction(l, serviceList); } model.addAttribute("page", page); logger.info("查询Ftp日志成功"); @@ -85,5 +93,68 @@ public class FtpLogController extends BaseController{ } return "/log/ntc/ftpList"; } - + + // ftp配置导出 + @RequestMapping(value = "exportFtp") + public void exportFtp(@ModelAttribute("log") NtcFtpLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + System.out.println("进来了Ftp"); + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_FTP_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (NtcFtpLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + titleList.add("ftp_control"); + classMap.put("ftp_control", NtcFtpLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = "," + hColumns; + noExportMap.put("ftp_control", cfgIndexInfoNoExport); + dataMap.put("ftp_control", list); + /* } */ + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "ftp_control", titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "ftp_control", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("ftp_control export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } } diff --git a/src/main/java/com/nis/web/controller/log/ntc/HttpKeyLogController.java b/src/main/java/com/nis/web/controller/log/ntc/HttpKeyLogController.java index c2d35b195..b5ff8cd77 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/HttpKeyLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/HttpKeyLogController.java @@ -1,5 +1,6 @@ package com.nis.web.controller.log.ntc; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -13,6 +14,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -20,21 +22,24 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.log.NtcFtpLog; -import com.nis.domain.log.NtcHttpLog; +import com.nis.domain.log.NtcKeywordsUrlLog; import com.nis.domain.log.NtcKeywordsUrlLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping("${adminPath}/log/ntc/httpkey") public class HttpKeyLogController extends BaseController { - + @RequestMapping("list") - public String list(@ModelAttribute("log") NtcKeywordsUrlLog log, Model model, HttpServletRequest request, HttpServletResponse response) { + public String list(@ModelAttribute("log") NtcKeywordsUrlLog log, Model model, HttpServletRequest request, + HttpServletResponse response) { try { PageLog page = new PageLog(request, response); Map params = new HashMap(); @@ -44,16 +49,18 @@ public class HttpKeyLogController extends BaseController { params.put("searchUrl", log.getUrl()); } initLogSearchValue(log, params); - + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); model.addAttribute("serviceList", serviceList); - + String url = Constants.LOG_BASE_URL + Constants.NTC_KEYWORDS_URL_LOG; String recv = HttpClientUtil.getMsg(url, params, request); - + Gson gson = new GsonBuilder().create(); - - LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + + LogRecvData fromJson = gson.fromJson(recv, + new TypeToken>() { + }.getType()); if (fromJson.getStatus().intValue() == 200) { Page data = fromJson.getData(); page.setCount(data.getCount()); @@ -62,7 +69,7 @@ public class HttpKeyLogController extends BaseController { List list = page.getList(); for (NtcKeywordsUrlLog l : list) { l.setFunctionId(log.getFunctionId()); - setLogAction(l,serviceList); + setLogAction(l, serviceList); } model.addAttribute("page", page); } @@ -70,7 +77,72 @@ public class HttpKeyLogController extends BaseController { logger.error("查询失败", e); addMessageLog(model, e.getMessage()); } - + return "/log/ntc/httpKeyList"; } + + // httpKey配置导出 + @RequestMapping(value = "exportHttpKey") + public void exportHttpKey(@ModelAttribute("log") NtcKeywordsUrlLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + System.out.println("进来了httpKey"); + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_KEYWORDS_URL_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, + new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (NtcKeywordsUrlLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + titleList.add("http_keyword"); + classMap.put("http_keyword", NtcKeywordsUrlLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = "," + hColumns; + noExportMap.put("http_keyword", cfgIndexInfoNoExport); + dataMap.put("http_keyword", list); + /* } */ + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "http_keyword", titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "http_keyword", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("http_keyword export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } } diff --git a/src/main/java/com/nis/web/controller/log/ntc/HttpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/HttpLogController.java index ef260f6e4..b0a5a645b 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/HttpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/HttpLogController.java @@ -1,5 +1,6 @@ package com.nis.web.controller.log.ntc; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -12,6 +13,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -19,19 +21,23 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; +import com.nis.domain.log.NtcHttpLog; import com.nis.domain.log.NtcHttpLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping("${adminPath}/log/ntc/http") public class HttpLogController extends BaseController { - + @RequestMapping("list") - public String list(@ModelAttribute("log") NtcHttpLog log, Model model, HttpServletRequest request, HttpServletResponse response) { + public String list(@ModelAttribute("log") NtcHttpLog log, Model model, HttpServletRequest request, + HttpServletResponse response) { try { PageLog page = new PageLog(request, response); Map params = new HashMap(); @@ -41,32 +47,33 @@ public class HttpLogController extends BaseController { params.put("searchUrl", log.getUrl()); } initLogSearchValue(log, params); - + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); serviceList.addAll(DictUtils.getFunctionServiceDictList(635)); for (FunctionServiceDict serviceDict : serviceList) { - if(serviceDict.getFunctionId() == log.getFunctionId()){ - if(serviceDict.getAction() == Constants.MONIT_ACTION){ + if (serviceDict.getFunctionId() == log.getFunctionId()) { + if (serviceDict.getAction() == Constants.MONIT_ACTION) { serviceDict.setActionCode("log_search_http_monit"); - }else if(serviceDict.getAction() == Constants.REJECT_ACTION){ + } else if (serviceDict.getAction() == Constants.REJECT_ACTION) { serviceDict.setActionCode("log_search_http_reject"); } - }else{ - if(serviceDict.getAction() == Constants.MONIT_ACTION){ + } else { + if (serviceDict.getAction() == Constants.MONIT_ACTION) { serviceDict.setActionCode("log_search_keyword_monit"); - }else if(serviceDict.getAction() == Constants.REJECT_ACTION){ + } else if (serviceDict.getAction() == Constants.REJECT_ACTION) { serviceDict.setActionCode("log_search_keyword_reject"); } } } model.addAttribute("serviceList", serviceList); - + String url = Constants.LOG_BASE_URL + Constants.NTC_HTTP_LOG; String recv = HttpClientUtil.getMsg(url, params, request); - + Gson gson = new GsonBuilder().create(); - - LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); if (fromJson.getStatus().intValue() == 200) { Page data = fromJson.getData(); page.setCount(data.getCount()); @@ -75,7 +82,7 @@ public class HttpLogController extends BaseController { List list = page.getList(); for (NtcHttpLog l : list) { l.setFunctionId(log.getFunctionId()); - setLogAction(l,serviceList); + setLogAction(l, serviceList); } model.addAttribute("page", page); } @@ -83,7 +90,70 @@ public class HttpLogController extends BaseController { logger.error("查询失败", e); addMessageLog(model, e.getMessage()); } - + return "/log/ntc/httpList"; } + + // http配置导出 + @RequestMapping(value = "exportHttp") + public void exportHttp(@ModelAttribute("log") NtcHttpLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_HTTP_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (NtcHttpLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + titleList.add("HTTP"); + classMap.put("HTTP", NtcHttpLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",req_hdr_key,req_hdr_file,req_body_key,req_body_file,res_hdr_key,res_hdr_file,res_body_key,res_body_file,scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = "," + hColumns; + noExportMap.put("HTTP", cfgIndexInfoNoExport); + dataMap.put("HTTP", list); + /* } */ + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "HTTP", titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "HTTP", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("HTTP export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } } diff --git a/src/main/java/com/nis/web/controller/log/ntc/IpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/IpLogController.java index 0fbf42732..26eefdb35 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/IpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/IpLogController.java @@ -2,6 +2,7 @@ package com.nis.web.controller.log.ntc; import java.io.File; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -17,6 +18,7 @@ import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -24,14 +26,17 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.log.NtcHttpLog; import com.nis.domain.log.NtcIpLog; +import com.nis.domain.log.NtcIpLog; import com.nis.domain.maat.LogRecvData; import com.nis.exceptions.MaatConvertException; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping("${adminPath}/log/ntc/ip") @@ -111,4 +116,69 @@ public class IpLogController extends BaseController { return "/log/ntc/ipList"; } + // Ip配置导出 + @RequestMapping(value = "exportIp") + public void exportIp(@ModelAttribute("log") NtcIpLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + + String url = Constants.LOG_BASE_URL + Constants.NTC_IP_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (NtcIpLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + + titleList.add("Ip"); + classMap.put("Ip", NtcIpLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = "," + hColumns; + noExportMap.put("Ip", cfgIndexInfoNoExport); + dataMap.put("Ip", list); + + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "Ip", titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "Ip", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("Ip" +" export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } + } diff --git a/src/main/java/com/nis/web/controller/log/ntc/MailLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MailLogController.java index 436d9abbb..8f14dc0ec 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MailLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MailLogController.java @@ -1,5 +1,6 @@ package com.nis.web.controller.log.ntc; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -14,6 +15,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -21,27 +23,31 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.log.NtcIpLog; import com.nis.domain.log.NtcMailLog; +import com.nis.domain.log.NtcMailLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping("${adminPath}/log/ntc/mail") public class MailLogController extends BaseController { - + @RequestMapping("list") - public String list(@ModelAttribute("log") NtcMailLog log, Model model, HttpServletRequest request, HttpServletResponse response) { + public String list(@ModelAttribute("log") NtcMailLog log, Model model, HttpServletRequest request, + HttpServletResponse response) { try { PageLog page = new PageLog(request, response); Map params = new HashMap(); params.put("pageSize", page.getPageSize()); params.put("pageNo", page.getPageNo()); initLogSearchValue(log, params); - + // 增加收/发件人、邮件主题查询 if (StringUtils.isNotBlank(log.getMailTo())) { params.put("searchMailTo", StringEscapeUtils.unescapeHtml(log.getMailTo())); @@ -52,16 +58,17 @@ public class MailLogController extends BaseController { if (StringUtils.isNotBlank(log.getSubject())) { params.put("searchSubject", StringEscapeUtils.unescapeHtml(log.getSubject())); } - + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); model.addAttribute("serviceList", serviceList); - + String url = Constants.LOG_BASE_URL + Constants.NTC_MAIL_LOG; String recv = HttpClientUtil.getMsg(url, params, request); - + if (StringUtils.isNotBlank(recv)) { Gson gson = new GsonBuilder().create(); - LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); if (fromJson.getStatus().intValue() == 200) { Page data = fromJson.getData(); page.setCount(data.getCount()); @@ -70,7 +77,7 @@ public class MailLogController extends BaseController { List list = page.getList(); for (NtcMailLog l : list) { l.setFunctionId(log.getFunctionId()); - setLogAction(l,serviceList); + setLogAction(l, serviceList); } model.addAttribute("page", page); } @@ -79,7 +86,71 @@ public class MailLogController extends BaseController { logger.error("查询失败", e); addMessageLog(model, e.getMessage()); } - + return "/log/ntc/mailList"; } + + // Mail配置导出 + @RequestMapping(value = "exportMail") + public void exportMail(@ModelAttribute("log") NtcMailLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + System.out.println("进来了Mail"); + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_MAIL_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (NtcMailLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + titleList.add("mail_control"); + classMap.put("mail_control", NtcMailLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = "," + hColumns; + noExportMap.put("mail_control", cfgIndexInfoNoExport); + dataMap.put("mail_control", list); + /* } */ + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "mail_control", titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "mail_control", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("mail_control export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } } diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmAvUrlLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MmAvUrlLogController.java index 2a9705cc2..688e8dbaf 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmAvUrlLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmAvUrlLogController.java @@ -1,6 +1,7 @@ package com.nis.web.controller.log.ntc; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -8,12 +9,14 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang3.StringUtils; import org.apache.http.client.ClientProtocolException; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -21,20 +24,24 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.log.MmAvIpLog; import com.nis.domain.log.NtcStreamMediaLog; +import com.nis.domain.log.NtcStreamMediaLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping(value = "${adminPath}/log/ntc/mmAvUrlLogs") -public class MmAvUrlLogController extends BaseController{ +public class MmAvUrlLogController extends BaseController { /** * 音视频url日志 + * * @param model * @param entry * @param request @@ -43,29 +50,32 @@ public class MmAvUrlLogController extends BaseController{ * @throws ClientProtocolException * @throws IOException */ - @RequestMapping(value={"list",""}) - public String list(Model model,@ModelAttribute("log")NtcStreamMediaLog entry,HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException { - + @RequestMapping(value = { "list", "" }) + public String list(Model model, @ModelAttribute("log") NtcStreamMediaLog entry, HttpServletRequest request, + HttpServletResponse response) throws ClientProtocolException, IOException { + try { - + PageLog page = new PageLog(request, response); - Map params=new HashMap<>(); + Map params = new HashMap<>(); params.put("pageSize", page.getPageSize()); params.put("pageNo", page.getPageNo()); - //查询值判断 - initLogSearchValue(entry,params); - + // 查询值判断 + initLogSearchValue(entry, params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); model.addAttribute("serviceList", serviceList); - + String url = ""; - url = Constants.LOG_BASE_URL+Constants.NTC_STREAMMEDIA_LOG; - String jsonString = HttpClientUtil.getMsg(url,params,request); - + url = Constants.LOG_BASE_URL + Constants.NTC_STREAMMEDIA_LOG; + String jsonString = HttpClientUtil.getMsg(url, params, request); + Gson gson = new GsonBuilder().create(); - //gson泛型支持 - LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>(){}.getType()); - + // gson泛型支持 + LogRecvData fromJson = gson.fromJson(jsonString, + new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { Page data = fromJson.getData(); page.setCount(data.getCount()); @@ -74,7 +84,7 @@ public class MmAvUrlLogController extends BaseController{ List list = page.getList(); for (NtcStreamMediaLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l,serviceList); + setLogAction(l, serviceList); } model.addAttribute("page", page); logger.info("查询音视频url日志成功"); @@ -85,5 +95,70 @@ public class MmAvUrlLogController extends BaseController{ } return "/log/ntc/ntcStreamMedia"; } - + + // AvUrl配置导出 + @RequestMapping(value = "exportAvUrl") + public void exportAvUrl(@ModelAttribute("log") NtcStreamMediaLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + System.out.println("进来了AvUrl"); + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_STREAMMEDIA_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, + new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (NtcStreamMediaLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + titleList.add("streaming_media"); + classMap.put("streaming_media", NtcStreamMediaLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = "," + hColumns; + noExportMap.put("streaming_media", cfgIndexInfoNoExport); + dataMap.put("streaming_media", list); + /* } */ + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "streaming_media", titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "streaming_media", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("streaming_media export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } + } diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmFileDigestLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MmFileDigestLogController.java index 9cd40063c..4a8711f88 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmFileDigestLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmFileDigestLogController.java @@ -1,6 +1,7 @@ package com.nis.web.controller.log.ntc; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -14,6 +15,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -21,20 +23,24 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.log.MmFileDigestLog; import com.nis.domain.log.NtcStreamMediaLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; +import com.nis.util.StringUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping(value = "${adminPath}/log/ntc/mmFileDigestLogs") -public class MmFileDigestLogController extends BaseController{ +public class MmFileDigestLogController extends BaseController { /** * 音视频url日志 + * * @param model * @param entry * @param request @@ -43,29 +49,32 @@ public class MmFileDigestLogController extends BaseController{ * @throws ClientProtocolException * @throws IOException */ - @RequestMapping(value={"list",""}) - public String list(Model model,@ModelAttribute("log")MmFileDigestLog entry,HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException { - + @RequestMapping(value = { "list", "" }) + public String list(Model model, @ModelAttribute("log") MmFileDigestLog entry, HttpServletRequest request, + HttpServletResponse response) throws ClientProtocolException, IOException { + try { - + PageLog page = new PageLog(request, response); - Map params=new HashMap<>(); + Map params = new HashMap<>(); params.put("pageSize", page.getPageSize()); params.put("pageNo", page.getPageNo()); - //查询值判断 - initLogSearchValue(entry,params); - + // 查询值判断 + initLogSearchValue(entry, params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); model.addAttribute("serviceList", serviceList); - + String url = ""; - url = Constants.LOG_BASE_URL+Constants.NTC_MMFILEDIGEST_LOG; - String jsonString = HttpClientUtil.getMsg(url,params,request); - + url = Constants.LOG_BASE_URL + Constants.NTC_MMFILEDIGEST_LOG; + String jsonString = HttpClientUtil.getMsg(url, params, request); + Gson gson = new GsonBuilder().create(); - //gson泛型支持 - LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>(){}.getType()); - + // gson泛型支持 + LogRecvData fromJson = gson.fromJson(jsonString, + new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { Page data = fromJson.getData(); page.setCount(data.getCount()); @@ -74,7 +83,7 @@ public class MmFileDigestLogController extends BaseController{ List list = page.getList(); for (MmFileDigestLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l,serviceList); + setLogAction(l, serviceList); } model.addAttribute("page", page); logger.info("查询文件摘要日志成功"); @@ -85,5 +94,69 @@ public class MmFileDigestLogController extends BaseController{ } return "/log/ntc/mmFileDigestList"; } - + + // FileDigest配置导出 + @RequestMapping(value = "exportFileDigest") + public void exportFileDigest(@ModelAttribute("log") MmFileDigestLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + System.out.print(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_MMFILEDIGEST_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, + new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (MmFileDigestLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + titleList.add("file_digest_control"); + classMap.put("file_digest_control", MmFileDigestLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = ",log_uri,direction," + hColumns; + noExportMap.put("file_digest_control", cfgIndexInfoNoExport); + dataMap.put("file_digest_control", list); + + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "file_digest_control", titleList, classMap, dataMap, + noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "file_digest_control", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("FileDiges export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } } diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmPornAvSampleController.java b/src/main/java/com/nis/web/controller/log/ntc/MmPornAvSampleController.java index 7c658066c..d6843ad90 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmPornAvSampleController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmPornAvSampleController.java @@ -1,5 +1,6 @@ package com.nis.web.controller.log.ntc; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -12,6 +13,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -19,13 +21,16 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.log.MmAvIpLog; import com.nis.domain.log.MmPicUrlLog; +import com.nis.domain.log.MmSampleVideoLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping(value = "${adminPath}/log/ntc") @@ -115,4 +120,66 @@ public class MmPornAvSampleController extends BaseController { } return "/log/ntc/mmPornVideoSampleList"; } + + //Video配置导出 + @RequestMapping(value = "mmSampleVideoLevelLogs/exportVideo") + public void exportVideo(@ModelAttribute("log") MmAvIpLog log, Model model,String hColumns,String type, HttpServletRequest request, HttpServletResponse response,RedirectAttributes redirectAttributes){ + try { + //export data info + List titleList=new ArrayList(); + Map> classMap=new HashMap>(); + Map dataMap=new HashMap(); + Map noExportMap=new HashMap(); + //--------------------------- + + PageLog page = new PageLog(request, response); + Map params=new HashMap<>(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + //查询值判断 + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + List list=new ArrayList(); + String url = ""; + url = Constants.LOG_BASE_URL + Constants.NTC_MMPORNVIDEOSAMPLE_LOG; + String jsonString = HttpClientUtil.getMsg(url,params,request); + + Gson gson = new GsonBuilder().create(); + //gson泛型支持 + LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>(){}.getType()); + + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list= data.getList(); + } + for (MmAvIpLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l,serviceList); + } + titleList.add("av_sample_video_porn_control"); + classMap.put("av_sample_video_porn_control", MmSampleVideoLog.class); + SysUser user =UserUtils.getUser(); + if (!user.isAdmin()){ + hColumns+=",scene_file,"; + }else{ + hColumns+=","; + } + String cfgIndexInfoNoExport=","+hColumns; + noExportMap.put("av_sample_video_porn_control",cfgIndexInfoNoExport); + dataMap.put("av_sample_video_porn_control",list); + /*}*/ + if("csv".equals(type)){ + this._exportCsv(model, request, response, redirectAttributes,"av_sample_video_porn_control",titleList,classMap,dataMap,noExportMap); + }else{ + this._export(model, request, response, redirectAttributes,"av_sample_video_porn_control",titleList,classMap,dataMap,noExportMap); + } + } catch (Exception e) { + logger.error("Video export failed",e); + addMessage(redirectAttributes,"error","export_failed"); + } + } + + } diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmSampleAudioController.java b/src/main/java/com/nis/web/controller/log/ntc/MmSampleAudioController.java index e7685c58f..cdc4949d1 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmSampleAudioController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmSampleAudioController.java @@ -1,5 +1,6 @@ package com.nis.web.controller.log.ntc; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -12,6 +13,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -19,13 +21,16 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.log.MmAvIpLog; import com.nis.domain.log.MmSampleAudioLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; +import com.nis.util.StringUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping(value = "${adminPath}/log/ntc/mmSampleAudioLogs") @@ -71,4 +76,69 @@ public class MmSampleAudioController extends BaseController{ return "/log/ntc/mmSampleAudioList"; } + + // SampleAudio配置导出 + @RequestMapping(value = "exportSampleAudio") + public void exportSampleAudio(@ModelAttribute("log") MmSampleAudioLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + System.out.print(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_DDOS_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (MmSampleAudioLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + titleList.add("av_sample_audio_control"); + classMap.put("av_sample_audio_control", MmSampleAudioLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = ",direction," + hColumns; + noExportMap.put("av_sample_audio_control", cfgIndexInfoNoExport); + dataMap.put("av_sample_audio_control", list); + + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "av_sample_audio_control", titleList, classMap, dataMap, + noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "av_sample_audio_control", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("SampleAudio export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } + } diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmSamplePicController.java b/src/main/java/com/nis/web/controller/log/ntc/MmSamplePicController.java index 85d5168cd..000109e0f 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmSamplePicController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmSamplePicController.java @@ -1,6 +1,7 @@ package com.nis.web.controller.log.ntc; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -13,6 +14,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -20,12 +22,15 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.log.MmSamplePicLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; +import com.nis.util.StringUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping(value = "${adminPath}/log/ntc/mmSamplePicLogs") @@ -71,4 +76,64 @@ public class MmSamplePicController extends BaseController{ return "/log/ntc/mmSamplePicList"; } + + // SamplePic配置导出 + @RequestMapping(value = "exportSamplePic") + public void exportSamplePic(@ModelAttribute("log") MmSamplePicLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + try { + + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + + PageLog page = new PageLog(request,response); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + + // 请求参数判断 + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + List list=new ArrayList(); + // 请求接口 + String url = Constants.LOG_BASE_URL + Constants.NTC_MMSAMPLEPIC_LOG; + String resJson = HttpClientUtil.getMsg(url, params, request); + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(resJson, new TypeToken>() {}.getType()); + if(fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + for (MmSamplePicLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + titleList.add("SamplePic"); + classMap.put("SamplePic", MmSamplePicLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = ",direction," + hColumns; + noExportMap.put("av_sample_picture_control", cfgIndexInfoNoExport); + dataMap.put("av_sample_picture_control", list); + + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "av_sample_picture_control", titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "av_sample_picture_control", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("SamplePic export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } } diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmSampleVideoController.java b/src/main/java/com/nis/web/controller/log/ntc/MmSampleVideoController.java index 2e2516083..7e584bbd3 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmSampleVideoController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmSampleVideoController.java @@ -1,31 +1,32 @@ package com.nis.web.controller.log.ntc; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - -import org.springframework.beans.BeanUtils; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; - +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; -import com.nis.domain.log.MmSamplePicLog; +import com.nis.domain.SysUser; import com.nis.domain.log.MmSampleVideoLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping(value = "${adminPath}/log/ntc/mmSampleVideoLogs") @@ -71,4 +72,69 @@ public class MmSampleVideoController extends BaseController{ return "/log/ntc/mmSampleVideoList"; } + + // SampleVideo配置导出 + @RequestMapping(value = "exportSampleVideo") + public void exportSampleVideo(@ModelAttribute("log") MmSampleVideoLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + System.out.print(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_DDOS_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (MmSampleVideoLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + titleList.add("av_sample_video_control"); + classMap.put("av_sample_video_control", MmSampleVideoLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = ",direction," + hColumns; + noExportMap.put("av_sample_video_control", cfgIndexInfoNoExport); + dataMap.put("av_sample_video_control", list); + + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "av_sample_video_control", titleList, classMap, dataMap, + noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "av_sample_video_control", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("SampleVideo export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } + } diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmSampleVoipLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MmSampleVoipLogController.java index 829e3db47..124ff3d2e 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmSampleVoipLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmSampleVoipLogController.java @@ -1,6 +1,7 @@ package com.nis.web.controller.log.ntc; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -8,12 +9,14 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang3.StringUtils; import org.apache.http.client.ClientProtocolException; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -21,13 +24,14 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; -import com.nis.domain.log.MmSampleVideoLog; +import com.nis.domain.SysUser; import com.nis.domain.log.MmVoipLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping(value = "${adminPath}/log/ntc/mmSampleVoipLogs") @@ -75,4 +79,67 @@ public class MmSampleVoipLogController extends BaseController { } return "/log/ntc/mmSampleVoipList"; } + + + + + //exportVoip配置导出 + @RequestMapping(value = "exportVoip") + public void exportVoip(@ModelAttribute("log") MmVoipLog log, Model model,String hColumns,String type, HttpServletRequest request, HttpServletResponse response,RedirectAttributes redirectAttributes){ + try { + //export data info + List titleList=new ArrayList(); + Map> classMap=new HashMap>(); + Map dataMap=new HashMap(); + Map noExportMap=new HashMap(); + //--------------------------- + + PageLog page = new PageLog(request, response); + Map params=new HashMap<>(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + //查询值判断 + initLogSearchValue(log,params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + List list=new ArrayList(); + String url = Constants.LOG_BASE_URL+Constants.NTC_MMSAMPLE_VOIP_LOG; + String jsonString = HttpClientUtil.getMsg(url,params,request); + + Gson gson = new GsonBuilder().create(); + //gson泛型支持 + LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>(){}.getType()); + + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list= data.getList(); + } + for (MmVoipLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l,serviceList); + } + + titleList.add("av_sample_voip_control"); + classMap.put("av_sample_voip_control", MmVoipLog.class); + SysUser user =UserUtils.getUser(); + if (!user.isAdmin()){ + hColumns+=",scene_file,"; + }else{ + hColumns+=","; + } + String cfgIndexInfoNoExport=","+hColumns; + noExportMap.put("av_sample_voip_control",cfgIndexInfoNoExport); + dataMap.put("av_sample_voip_control",list); + /*}*/ + if("csv".equals(type)){ + this._exportCsv(model, request, response, redirectAttributes,"av_sample_voip_control",titleList,classMap,dataMap,noExportMap); + }else{ + this._export(model, request, response, redirectAttributes,"av_sample_voip_control",titleList,classMap,dataMap,noExportMap); + } + } catch (Exception e) { + logger.error("voip export failed",e); + addMessage(redirectAttributes,"error","export_failed"); + } + } } diff --git a/src/main/java/com/nis/web/controller/log/ntc/MmVoipIpLogController.java b/src/main/java/com/nis/web/controller/log/ntc/MmVoipIpLogController.java index 7a6c0bf26..84000937c 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/MmVoipIpLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/MmVoipIpLogController.java @@ -1,6 +1,7 @@ package com.nis.web.controller.log.ntc; import java.io.IOException; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -8,12 +9,14 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang3.StringUtils; import org.apache.http.client.ClientProtocolException; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -21,16 +24,19 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; +import com.nis.domain.log.MmVoipLog; import com.nis.domain.log.MmVoipLog; import com.nis.domain.maat.LogRecvData; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping(value = "${adminPath}/log/ntc/mmVoipIpLogs") -public class MmVoipIpLogController extends BaseController{ +public class MmVoipIpLogController extends BaseController { /** * @param model @@ -41,29 +47,31 @@ public class MmVoipIpLogController extends BaseController{ * @throws ClientProtocolException * @throws IOException */ - @RequestMapping(value={"list",""}) - public String list(Model model,@ModelAttribute("log")MmVoipLog entry,HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException { - + @RequestMapping(value = { "list", "" }) + public String list(Model model, @ModelAttribute("log") MmVoipLog entry, HttpServletRequest request, + HttpServletResponse response) throws ClientProtocolException, IOException { + try { - + PageLog page = new PageLog(request, response); - Map params=new HashMap<>(); + Map params = new HashMap<>(); params.put("pageSize", page.getPageSize()); params.put("pageNo", page.getPageNo()); - //查询值判断 - initLogSearchValue(entry,params); - + // 查询值判断 + initLogSearchValue(entry, params); + List serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId()); model.addAttribute("serviceList", serviceList); - + String url = ""; - url = Constants.LOG_BASE_URL+Constants.NTC_MMVOIP_LOG; - String jsonString = HttpClientUtil.getMsg(url,params,request); - + url = Constants.LOG_BASE_URL + Constants.NTC_MMVOIP_LOG; + String jsonString = HttpClientUtil.getMsg(url, params, request); + Gson gson = new GsonBuilder().create(); - //gson泛型支持 - LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>(){}.getType()); - + // gson泛型支持 + LogRecvData fromJson = gson.fromJson(jsonString, new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { Page data = fromJson.getData(); page.setCount(data.getCount()); @@ -72,7 +80,7 @@ public class MmVoipIpLogController extends BaseController{ List list = page.getList(); for (MmVoipLog l : list) { l.setFunctionId(entry.getFunctionId()); - setLogAction(l,serviceList); + setLogAction(l, serviceList); } model.addAttribute("page", page); logger.info("查询Voip日志成功"); @@ -83,5 +91,69 @@ public class MmVoipIpLogController extends BaseController{ } return "/log/ntc/mmVoipIpList"; } - + + // Voip配置导出 + @RequestMapping(value = "exportVoip") + public void exportVoip(@ModelAttribute("log") MmVoipLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + System.out.println("进来了Voip"); + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_MMVOIP_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (MmVoipLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + titleList.add("av_voip_control"); + classMap.put("av_voip_control", MmVoipLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",duation,from_to_store_ip,from_to_store_url,to_from_store_ip,to_from_store_url,log_uri,direction,scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = "," + hColumns; + noExportMap.put("av_voip_control", cfgIndexInfoNoExport); + dataMap.put("av_voip_control", list); + /* } */ + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "av_voip_control", titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "av_voip_control", titleList, classMap, + dataMap, noExportMap); + } + } catch (Exception e) { + logger.error("av_voip_control export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } + } diff --git a/src/main/java/com/nis/web/controller/log/ntc/NtcConnRecordLogController.java b/src/main/java/com/nis/web/controller/log/ntc/NtcConnRecordLogController.java index a9cb9f65d..6f218bf97 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/NtcConnRecordLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/NtcConnRecordLogController.java @@ -18,6 +18,7 @@ import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -26,10 +27,12 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.log.IrDnatLog; import com.nis.domain.log.IrSnatLog; import com.nis.domain.log.NtcCollectRadiusLog; import com.nis.domain.log.NtcConnRecordLog; +import com.nis.domain.log.NtcConnRecordLog; import com.nis.domain.log.SearchReport; import com.nis.domain.maat.LogRecvData; import com.nis.domain.report.NtcServiceReport; @@ -42,43 +45,48 @@ import com.nis.util.StringUtil; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; import com.nis.web.dao.dashboard.codedic.CodeResult; +import com.nis.web.security.UserUtils; import net.sf.json.JSONObject; @Controller @RequestMapping("${adminPath}/log/ntc/connRecordLogs") public class NtcConnRecordLogController extends BaseController { - - @RequestMapping(value = {"/list", ""}) - public String connRecordLogs(@ModelAttribute("log") NtcConnRecordLog log, Model model, HttpServletRequest request, HttpServletResponse response) { + + @RequestMapping(value = { "/list", "" }) + public String connRecordLogs(@ModelAttribute("log") NtcConnRecordLog log, Model model, HttpServletRequest request, + HttpServletResponse response) { try { PageLog page = new PageLog(request, response); Map params = new HashMap(); params.put("pageSize", page.getPageSize()); params.put("pageNo", page.getPageNo()); initLogSearchValue(log, params); - + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); model.addAttribute("serviceList", serviceList); - List appList=CodeDicUtils.getCodeList("appCode"); + List appList = CodeDicUtils.getCodeList("appCode"); model.addAttribute("appList", appList); - - String url =Constants.LOG_BASE_URL + Constants.NTC_CONN_RECORD_LOG; + + String url = Constants.LOG_BASE_URL + Constants.NTC_CONN_RECORD_LOG; String recv = HttpClientUtil.getMsg(url, params, request); - + if (StringUtils.isNotBlank(recv)) { Gson gson = new GsonBuilder().create(); - LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + LogRecvData fromJson = gson.fromJson(recv, + new TypeToken>() { + }.getType()); if (fromJson.getStatus().intValue() == 200) { Page data = fromJson.getData(); page.setCount(data.getCount()); page.setLast(data.getLast()); page.setList(data.getList()); - /*List list = page.getList(); - for (NtcConnRecordLog l : list) { - l.setFunctionId(log.getFunctionId()); - setLogAction(l,serviceList); - }*/ + /* + * List list = page.getList(); for + * (NtcConnRecordLog l : list) { + * l.setFunctionId(log.getFunctionId()); + * setLogAction(l,serviceList); } + */ model.addAttribute("page", page); } } @@ -86,41 +94,102 @@ public class NtcConnRecordLogController extends BaseController { logger.error("查询失败", e); addMessageLog(model, e.getMessage()); } - + return "/log/ntc/connRecordLogList"; } - - + @RequestMapping("/ajaxConnRecordPercent") @ResponseBody - public JSONObject ajaxConnRecordPercent(String searchFoundStartTime, - String searchFoundEndTime, - String searchStreamDir, - HttpServletRequest request, - HttpServletResponse response) { - JSONObject resultAllJson=new JSONObject(); - JSONObject result=new JSONObject(); - Map params=new HashMap<>(); + public JSONObject ajaxConnRecordPercent(String searchFoundStartTime, String searchFoundEndTime, + String searchStreamDir, HttpServletRequest request, HttpServletResponse response) { + JSONObject resultAllJson = new JSONObject(); + JSONObject result = new JSONObject(); + Map params = new HashMap<>(); try { params.put("searchFoundStartTime", searchFoundStartTime); params.put("searchFoundEndTime", searchFoundEndTime); - StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_CONN_RECORD_PERCENT); - String json=HttpClientUtil.getMsg(url.toString(), params,request); - if(!StringUtil.isEmpty(json)) { - resultAllJson=JSONObject.fromObject(json); - if(!StringUtil.isEmpty(resultAllJson)) { - result=(JSONObject) resultAllJson.get("data"); + StringBuffer url = new StringBuffer(Constants.LOG_BASE_URL + Constants.NTC_CONN_RECORD_PERCENT); + String json = HttpClientUtil.getMsg(url.toString(), params, request); + if (!StringUtil.isEmpty(json)) { + resultAllJson = JSONObject.fromObject(json); + if (!StringUtil.isEmpty(resultAllJson)) { + result = (JSONObject) resultAllJson.get("data"); } } - result.put("success","success"); + result.put("success", "success"); } catch (MaatConvertException e) { - logger.error("ajaxConnRecordPercent检索失败",e); - result.put("error",getMsgProp().get("request_service_failed")); - }catch (Exception e) { - logger.error("ajaxConnRecordPercent检索失败",e); - result.put("error",getMsgProp().get("search_error")); - } + logger.error("ajaxConnRecordPercent检索失败", e); + result.put("error", getMsgProp().get("request_service_failed")); + } catch (Exception e) { + logger.error("ajaxConnRecordPercent检索失败", e); + result.put("error", getMsgProp().get("search_error")); + } return result; } - + + // ConnRecord配置导出 + @RequestMapping(value = "exportConnRecord") + public void exportConnRecord(@ModelAttribute("log") NtcConnRecordLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + System.out.println("进来了ConnRecord"); + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_CONN_RECORD_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, + new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (NtcConnRecordLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + titleList.add("conn_record"); + classMap.put("conn_record", NtcConnRecordLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = ",cfg_id,action," + hColumns; + noExportMap.put("conn_record", cfgIndexInfoNoExport); + dataMap.put("conn_record", list); + /* } */ + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "conn_record", titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "conn_record", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("conn_record export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } + } diff --git a/src/main/java/com/nis/web/controller/log/ntc/P2pLogController.java b/src/main/java/com/nis/web/controller/log/ntc/P2pLogController.java index bad42ada8..16483b582 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/P2pLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/P2pLogController.java @@ -1,5 +1,6 @@ package com.nis.web.controller.log.ntc; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -13,6 +14,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -20,6 +22,8 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; +import com.nis.domain.log.NtcP2pLog; import com.nis.domain.log.NtcOpenVpnLog; import com.nis.domain.log.NtcP2pLog; import com.nis.domain.maat.LogRecvData; @@ -27,13 +31,15 @@ import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping("${adminPath}/log/ntc/p2pLogs") public class P2pLogController extends BaseController { - - @RequestMapping(value = {"list", ""}) - public String list(@ModelAttribute("log") NtcP2pLog log, Model model, HttpServletRequest request, HttpServletResponse response) { + + @RequestMapping(value = { "list", "" }) + public String list(@ModelAttribute("log") NtcP2pLog log, Model model, HttpServletRequest request, + HttpServletResponse response) { try { PageLog page = new PageLog(request, response); Map params = new HashMap(); @@ -43,13 +49,14 @@ public class P2pLogController extends BaseController { List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); model.addAttribute("serviceList", serviceList); - + String url = Constants.LOG_BASE_URL + Constants.NTC_P2P_LOG; - String recv = HttpClientUtil.getMsg(url, params, request); + String recv = HttpClientUtil.getMsg(url, params, request); logger.error("查询结果:" + recv); if (StringUtils.isNotBlank(recv)) { Gson gson = new GsonBuilder().create(); - LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); if (fromJson.getStatus().intValue() == 200) { Page data = fromJson.getData(); page.setCount(data.getCount()); @@ -58,7 +65,7 @@ public class P2pLogController extends BaseController { List list = page.getList(); for (NtcP2pLog l : list) { l.setFunctionId(log.getFunctionId()); - setLogAction(l,serviceList); + setLogAction(l, serviceList); } model.addAttribute("page", page); } @@ -67,8 +74,72 @@ public class P2pLogController extends BaseController { logger.error("查询失败", e); addMessageLog(model, e.getMessage()); } - + return "/log/ntc/p2pList"; } - + + // p2p配置导出 + @RequestMapping(value = "exportP2p") + public void exportP2p(@ModelAttribute("log") NtcP2pLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + System.out.println("进来了P2p"); + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_P2P_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (NtcP2pLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + titleList.add("p2p_control"); + classMap.put("p2p_control", NtcP2pLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = "," + hColumns; + noExportMap.put("p2p_control", cfgIndexInfoNoExport); + dataMap.put("p2p_control", list); + /* } */ + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "p2p_control", titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "p2p_control", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("p2p_control export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } + } diff --git a/src/main/java/com/nis/web/controller/log/ntc/SslLogController.java b/src/main/java/com/nis/web/controller/log/ntc/SslLogController.java index 60cb6ee2f..3ee8920f9 100644 --- a/src/main/java/com/nis/web/controller/log/ntc/SslLogController.java +++ b/src/main/java/com/nis/web/controller/log/ntc/SslLogController.java @@ -1,5 +1,6 @@ package com.nis.web.controller.log.ntc; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -12,6 +13,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.google.gson.Gson; import com.google.gson.GsonBuilder; @@ -20,6 +22,8 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; +import com.nis.domain.log.NtcSslLog; import com.nis.domain.log.NtcSshLog; import com.nis.domain.log.NtcSslLog; import com.nis.domain.maat.LogRecvData; @@ -28,35 +32,39 @@ import com.nis.util.DictUtils; import com.nis.util.StringUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping("${adminPath}/log/ntc/sslLogs") +@SuppressWarnings("all") public class SslLogController extends BaseController { - @RequestMapping(value = {"/list"}) - public String list(HttpServletRequest request, HttpServletResponse response, Model model, @ModelAttribute("log")NtcSslLog ntcSslLog) { - - PageLog page = new PageLog(request,response); - Map params = new HashMap(); + @RequestMapping(value = { "/list" }) + public String list(HttpServletRequest request, HttpServletResponse response, Model model, + @ModelAttribute("log") NtcSslLog ntcSslLog) { + + PageLog page = new PageLog(request, response); + Map params = new HashMap(); params.put("pageSize", page.getPageSize()); params.put("pageNo", page.getPageNo()); - + // 请求参数判断 initLogSearchValue(ntcSslLog, params); - if(StringUtils.isNotBlank(ntcSslLog.getSni())) { + if (StringUtils.isNotBlank(ntcSslLog.getSni())) { params.put("SearchSni", ntcSslLog.getSni()); - } - + } + List serviceList = DictUtils.getFunctionServiceDictList(ntcSslLog.getFunctionId()); model.addAttribute("serviceList", serviceList); - + try { // 请求接口 String url = Constants.LOG_BASE_URL + Constants.NTC_SSL_LOG; String resJson = HttpClientUtil.getMsg(url, params, request); Gson gson = new GsonBuilder().create(); - LogRecvData fromJson = gson.fromJson(resJson, new TypeToken>() {}.getType()); - if(fromJson.getStatus().intValue() == 200) { + LogRecvData fromJson = gson.fromJson(resJson, new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { Page data = fromJson.getData(); page.setCount(data.getCount()); page.setLast(data.getLast()); @@ -64,7 +72,7 @@ public class SslLogController extends BaseController { List list = page.getList(); for (NtcSslLog log : list) { log.setFunctionId(ntcSslLog.getFunctionId()); - setLogAction(log,serviceList); + setLogAction(log, serviceList); } model.addAttribute("page", page); } @@ -72,7 +80,71 @@ public class SslLogController extends BaseController { logger.error("SSL日志查询失败", e); addMessageLog(model, e.getMessage()); } - + return "/log/ntc/sslLogList"; } + + // Ssl配置导出 + @RequestMapping(value = "exportSsl") + public void exportSsl(@ModelAttribute("log") NtcSslLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + System.out.println("进来了ssl"); + try { + // export data info + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + String url = Constants.LOG_BASE_URL + Constants.NTC_SSL_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (NtcSslLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + titleList.add("ssl_control"); + classMap.put("ssl_control", NtcSslLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = "," + hColumns; + noExportMap.put("ssl_control", cfgIndexInfoNoExport); + dataMap.put("ssl_control", list); + /* } */ + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, "ssl_control", titleList, classMap, dataMap, + noExportMap); + } else { + this._export(model, request, response, redirectAttributes, "ssl_control", titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error("ssl_control export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } } diff --git a/src/main/java/com/nis/web/controller/log/pxy/PxyHttpLogController.java b/src/main/java/com/nis/web/controller/log/pxy/PxyHttpLogController.java index e44dc874b..ac2c9b510 100644 --- a/src/main/java/com/nis/web/controller/log/pxy/PxyHttpLogController.java +++ b/src/main/java/com/nis/web/controller/log/pxy/PxyHttpLogController.java @@ -1,5 +1,6 @@ package com.nis.web.controller.log.pxy; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -7,11 +8,13 @@ import java.util.Map; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; import org.springframework.web.servlet.support.RequestContext; import com.google.gson.Gson; @@ -20,6 +23,8 @@ import com.google.gson.reflect.TypeToken; import com.nis.domain.FunctionServiceDict; import com.nis.domain.Page; import com.nis.domain.PageLog; +import com.nis.domain.SysUser; +import com.nis.domain.log.NtcCollectRadiusLog; import com.nis.domain.log.NtcSslLog; import com.nis.domain.log.PxyHttpLog; import com.nis.domain.maat.LogRecvData; @@ -27,33 +32,35 @@ import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping("${adminPath}/log/pxy") public class PxyHttpLogController extends BaseController { - - @RequestMapping(value = {"list", "ipInterceptlogs", "domainInterceptlogs", "httpBlocklogs", - "httpRedirectlogs", "httpReplacelogs", "httpMonitogs"}) - public String list(@ModelAttribute("log") PxyHttpLog log, Model model, HttpServletRequest request, HttpServletResponse response) { + @RequestMapping(value = { "list", "ipInterceptlogs", "domainInterceptlogs", "httpBlocklogs", "httpRedirectlogs", + "httpReplacelogs", "httpMonitogs" }) + public String list(@ModelAttribute("log") PxyHttpLog log, Model model, HttpServletRequest request, + HttpServletResponse response) { try { setLogInfo(request, model, log); - + PageLog page = new PageLog(request, response); Map params = new HashMap(); params.put("pageSize", page.getPageSize()); params.put("pageNo", page.getPageNo()); - + initLogSearchValue(log, params); - + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); model.addAttribute("serviceList", serviceList); - + String url = Constants.LOG_BASE_URL + Constants.PXY_HTTP_LOG; String recv = HttpClientUtil.getMsg(url, params, request); - + Gson gson = new GsonBuilder().create(); - - LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); if (fromJson.getStatus().intValue() == 200) { Page data = fromJson.getData(); page.setCount(data.getCount()); @@ -62,24 +69,24 @@ public class PxyHttpLogController extends BaseController { List list = page.getList(); for (PxyHttpLog l : list) { l.setFunctionId(log.getFunctionId()); - setLogAction(l,serviceList); + setLogAction(l, serviceList); } model.addAttribute("page", page); } - + } catch (Exception e) { logger.error("查询失败", e); addMessageLog(model, e.getMessage()); } - + return "/log/pxy/pxyHttpList"; } - + private void setLogInfo(HttpServletRequest request, Model model, PxyHttpLog log) { int functionId = log.getFunctionId(); - + RequestContext requestContext = new RequestContext(request); - + if (functionId == 200) { model.addAttribute("logTitle", requestContext.getMessage("ip_intercept")); log.setAction(1); @@ -100,4 +107,81 @@ public class PxyHttpLogController extends BaseController { log.setAction(1); } } + + // proxy配置导出 + @RequestMapping(value = "exportPxy") + public void exportPxy(@ModelAttribute("log") PxyHttpLog log, Model model, String hColumns, String type, + HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) { + String name= "pxy"; + try { + // export data info + setLogInfo(request, model, log); + List titleList = new ArrayList(); + Map> classMap = new HashMap>(); + Map dataMap = new HashMap(); + Map noExportMap = new HashMap(); + // --------------------------- + PageLog page = new PageLog(request, response); + page.setPageNo(1); + page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + initLogSearchValue(log, params); + + List serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId()); + System.out.print(log.getFunctionId()); + model.addAttribute("serviceList", serviceList); + + + String url = Constants.LOG_BASE_URL + Constants.PXY_HTTP_LOG; + String recv = HttpClientUtil.getMsg(url, params, request); + List list = new ArrayList(); + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>() { + }.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + list = data.getList(); + } + } + for (PxyHttpLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l, serviceList); + } + if(log.getFunctionId()==210){ + name="http_monit"; + }else if(log.getFunctionId()==207){ + name="http_block"; + }else if(log.getFunctionId()==208){ + name="http_redirect"; + }else if(log.getFunctionId()==209){ + name="http_replace"; + } + + titleList.add(name); + classMap.put(name, PxyHttpLog.class); + SysUser user = UserUtils.getUser(); + if (!user.isAdmin()) { + hColumns += ",scene_file,"; + } else { + hColumns += ","; + } + String cfgIndexInfoNoExport = "," + hColumns; + noExportMap.put(name, cfgIndexInfoNoExport); + dataMap.put(name, list); + + if ("csv".equals(type)) { + this._exportCsv(model, request, response, redirectAttributes, name, titleList, classMap, + dataMap, noExportMap); + } else { + this._export(model, request, response, redirectAttributes, name, titleList, classMap, dataMap, + noExportMap); + } + } catch (Exception e) { + logger.error(name +" export failed", e); + addMessage(redirectAttributes, "error", "export_failed"); + } + } } diff --git a/src/main/java/com/nis/web/controller/report/ReportController.java b/src/main/java/com/nis/web/controller/report/ReportController.java index 53728d4ee..22dd8df2c 100644 --- a/src/main/java/com/nis/web/controller/report/ReportController.java +++ b/src/main/java/com/nis/web/controller/report/ReportController.java @@ -1,15 +1,39 @@ package com.nis.web.controller.report; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.reflect.TypeToken; +import com.nis.domain.Page; +import com.nis.domain.PageLog; +import com.nis.domain.SysUser; import com.nis.domain.log.SearchReport; +import com.nis.domain.maat.LogRecvData; +import com.nis.domain.report.NtcAsnRecord; +import com.nis.domain.report.NtcIpRangeReport; +import com.nis.domain.report.NtcURLReport; +import com.nis.util.Constants; +import com.nis.util.DateUtils; +import com.nis.util.DictUtils; +import com.nis.util.httpclient.HttpClientUtil; import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; @Controller @RequestMapping("${adminPath}/report") @@ -19,4 +43,170 @@ public class ReportController extends BaseController { initReportCondition(model, bean); return "/report/list"; } + //asn + @RequestMapping(value = {"/asnConnList", ""}) + public String asnConnLists(@ModelAttribute("log") NtcAsnRecord log, Model model, HttpServletRequest request, HttpServletResponse response) { + try { + PageLog page = new PageLog(request, response); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + //判断请求参数 + if (StringUtils.isNotBlank(log.getSearchFoundStartTime()) + && StringUtils.isNotBlank(log.getSearchFoundEndTime())) { + params.put("searchFoundStartTime", log.getSearchFoundStartTime()); + params.put("searchFoundEndTime", log.getSearchFoundEndTime()); + } else { + Calendar time = Calendar.getInstance(); + String searchEndTime = DateUtils.formatDateTime(time.getTime()); + time.add(Calendar.HOUR_OF_DAY, -1); + String searchStartTime = DateUtils.formatDateTime(time.getTime()); + + params.put("searchFoundStartTime", searchStartTime); + params.put("searchFoundEndTime", searchEndTime); + log.setSearchFoundStartTime(searchStartTime); + log.setSearchFoundEndTime(searchEndTime); + } + + String url =Constants.LOG_BASE_URL + Constants.NTC_ASN_RECORD; + String recv = HttpClientUtil.getMsg(url, params, request); +// String recv="{\"status\":200,\"businessCode\":2001000,\"reason\":\"数据获取操作成功\",\"msg\":\"ASN通联关系(源,目的)检索成功\",\"fromuri\":\"/galaxy-service/service/log/v1/ntcAsnRecord\",\"logSource\":0,\"traceCode\":\"2018121609404451375322\",\"data\":" +// +"{\"pageNo\":1,\"pageSize\":30,\"count\":66564,\"last\":2219,\"list\":[{\"bps\":\"8.56\",\"pps\":\"0.07\",\"sAsn\":\"9198\",\"dAsn\":\"40545_26836\"},"+ +// "{\"bps\":\"3.68\",\"pps\":\"0.12\",\"sAsn\":\"9198\",\"dAsn\":\"19506\"},{\"bps\":\"1.77\",\"pps\":\"0.08\",\"sAsn\":\"38266\",\"dAsn\":\"N/A\"},"+ +// "{\"bps\":\"493.55\",\"pps\":\"0.76\",\"sAsn\":\"30922\",\"dAsn\":\"29555\"},{\"bps\":\"26.63\",\"pps\":\"0.04\",\"sAsn\":\"44546\",\"dAsn\":\"197482\"},"+ +// "{\"bps\":\"25.43\",\"pps\":\"0.45\",\"sAsn\":\"44391\",\"dAsn\":\"9198\"},{\"bps\":\"52.96\",\"pps\":\"0.08\",\"sAsn\":\"29555\",\"dAsn\":\"14080\"}]}}"; + + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + page.setCount(data.getCount()); + page.setLast(data.getLast()); + page.setList(data.getList()); + /*List list = page.getList(); + for (NtcConnRecordLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l,serviceList); + }*/ + model.addAttribute("page", page); + } + } + } catch (Exception e) { + logger.error("查询失败", e); + addMessageLog(model, e.getMessage()); + } + + return "/report/asnRecordList"; + } + + + // + @RequestMapping(value = {"/httpsUrlList", ""}) + public String httpsUrlLists(@ModelAttribute("log") NtcURLReport log, Model model, HttpServletRequest request, HttpServletResponse response) { + try { + PageLog page = new PageLog(request, response); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + //判断请求参数 + if (StringUtils.isNotBlank(log.getSearchReportStartTime()) + && StringUtils.isNotBlank(log.getSearchReportEndTime())) { + params.put("searchReportStartTime", log.getSearchReportStartTime()); + params.put("searchReportEndTime", log.getSearchReportEndTime()); + } else { + Calendar time = Calendar.getInstance(); + String searchEndTime = DateUtils.formatDateTime(time.getTime()); + time.add(Calendar.HOUR_OF_DAY, -1); + String searchStartTime = DateUtils.formatDateTime(time.getTime()); + + params.put("searchReportStartTime", searchStartTime); + params.put("searchReportEndTime", searchEndTime); + log.setSearchReportStartTime(searchStartTime); + log.setSearchReportEndTime(searchEndTime); + } + //url参数 + if (StringUtils.isNotBlank(log.getSearchUrl())) { + params.put("searchUrl", log.getSearchUrl()); + } + + String url =Constants.LOG_BASE_URL + Constants.NTC_URL_REPORT; + String recv = HttpClientUtil.getMsg(url, params, request); +// String recv="{\"status\":200,\"businessCode\":2001000,\"reason\":\"数据获取操作成功\",\"msg\":\"URL统计查询成功\",\"fromuri\":\"/galaxy-service/service/log/v1/ntcURLReport\",\"logSource\":0,\"traceCode\":\"2018121610374649425419\",\"data\":{\"pageNo\":1,\"pageSize\":30,\"count\":174,\"last\":6,\"list\":[{\"url\":\"142.44.167.226/eventproxy/v1/bulk\",\"urlCount\":1686,\"dataList\":[{\"sum\":1686,\"ipAddr\":\"100.101.129.6\"}]},{\"url\":\"188.0.145.98/YZ/e1cib/dlist?cmd=query\",\"urlCount\":2652,\"dataList\":[{\"sum\":1248,\"ipAddr\":\"188.0.145.98\"},{\"sum\":1404,\"ipAddr\":\"89.218.9.2\"}]},{\"url\":\"cdn7.alpha-ag.ru/1c1233923d1a6/c51e872ab5861be256408f6cafa99ed8/luckypatcher_v7.5.9.apk\",\"urlCount\":882,\"dataList\":[{\"sum\":882,\"ipAddr\":\"100.81.118.193\"}]}]}}"; + + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + page.setCount(data.getCount()); + page.setLast(data.getLast()); + page.setList(data.getList()); + /*List list = page.getList(); + for (NtcConnRecordLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l,serviceList); + }*/ + model.addAttribute("page", page); + } + } + } catch (Exception e) { + logger.error("查询失败", e); + addMessageLog(model, e.getMessage()); + } + + return "/report/urlReportList"; + } + + + //IP范围统计 + @RequestMapping(value = {"/ipRangeList", ""}) + public String ipRangeLists(@ModelAttribute("log") NtcIpRangeReport log, Model model, HttpServletRequest request, HttpServletResponse response) { + try { + PageLog page = new PageLog(request, response); + Map params = new HashMap(); + params.put("pageSize", page.getPageSize()); + params.put("pageNo", page.getPageNo()); + //判断请求参数 + //查询国家 + if (StringUtils.isNotBlank(log.getSearchCountry())) { + params.put("searchCountry", log.getSearchCountry()); + } + //查询开始IP + if (StringUtils.isNotBlank(log.getSearchStartIp())) { + params.put("searchStartIp", log.getSearchStartIp()); + } + //查询结束IP + if (StringUtils.isNotBlank(log.getSearchEndIp())) { + params.put("searchEndIp", log.getSearchEndIp()); + } + + String url =Constants.LOG_BASE_URL + Constants.NTC_IP_RANGE_REPORT; + String recv = HttpClientUtil.getMsg(url, params, request); +// String recv="{\"status\":200,\"businessCode\":2001000,\"reason\":\"数据获取操作成功\",\"msg\":\"URL统计查询成功\",\"fromuri\":\"/galaxy-service/service/log/v1/ntcIpRangeReport\",\"logSource\":0,\"traceCode\":\"2018121616062785920271\",\"data\":{\"pageNo\":1,\"pageSize\":30,\"count\":0,\"last\":1,\"list\":[{\"ipStart\":\"192.168.10.121\",\"ipEnd\":\"192.168.10.122\",\"ipStartNum\":3232238201,\"ipEndNum\":3232238202,\"ipSub\":\"255.255.255.252\"}]}}"; + + if (StringUtils.isNotBlank(recv)) { + Gson gson = new GsonBuilder().create(); + LogRecvData fromJson = gson.fromJson(recv, new TypeToken>(){}.getType()); + if (fromJson.getStatus().intValue() == 200) { + Page data = fromJson.getData(); + page.setCount(data.getCount()); + page.setLast(data.getLast()); + page.setList(data.getList()); + /*List list = page.getList(); + for (NtcConnRecordLog l : list) { + l.setFunctionId(log.getFunctionId()); + setLogAction(l,serviceList); + }*/ + model.addAttribute("page", page); + } + } + } catch (Exception e) { + logger.error("查询失败", e); + addMessageLog(model, e.getMessage()); + } + + return "/report/ipRangeReportList"; + } + } diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java index 2112edaf7..3257fa471 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java @@ -35,8 +35,11 @@ import com.nis.web.dao.MyBatisDao; */ @MyBatisDao public interface AppCfgDao { - //app策略配置增删改查 public List findAppPolicyList(AppPolicyCfg entity) ; + + + //app策略配置增删改查 + public List findAppByPolicyList(@Param("ids")String ids) ; public AppPolicyCfg getAppPolicyCfg(@Param("cfgId")Long cfgId,@Param("compileId")Integer compileId) ; public IpPortCfg getAppPolicyIpCfg(AppPolicyCfg entity) ; public List getAppPolicyIpList(AppPolicyCfg entity); @@ -106,4 +109,17 @@ public interface AppCfgDao { // 导入配置时数据批量入库使用 public void insertAppDomainCfgBatch(AppDomainCfg cfg); public void insertAppHttpCfgBatch(AppHttpCfg cfg); + + //app 主题网站配置查 + public List findAppByTopicDomainList(@Param("ids")String ids) ; + //app协议IP配置查 + public List findAppByIpList(@Param("ids")String ids) ; + //app http特征查 + public List findAppByHttpList(@Param("ids")String ids) ; + + //app 域名配置增删改查 + public List findAppByDomainList(@Param("ids")String ids) ; + + //app ssl证书特征配置CRUD + public List findAppBySslList(@Param("ids")String ids); } diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml index 5282b852b..89895b804 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml @@ -3004,4 +3004,95 @@ ) + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.java b/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.java index a20972d83..34dacf6a7 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.java @@ -62,4 +62,6 @@ public interface AppMultiFeatureCfgDao { public List getAppIpRangeCfg(@Param("compileId")Integer compileId,@Param("functionId")Integer functionId) ; public int insertAppIpRangeCfg(AppIpCfg entity); public void deleteAppIpRangeCfg(BaseCfg entity); + + public List findAppByFeatureIndexList(@Param("ids")String ids); } diff --git a/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.xml index ec1caaf13..e450dcd85 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppMultiFeatureCfgDao.xml @@ -521,4 +521,21 @@ delete from app_complex_feature_cfg where compile_id=#{compileId} and function_id=#{functionId} + + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/DdosCfgDao.java b/src/main/java/com/nis/web/dao/configuration/DdosCfgDao.java index b66e79800..e8349ca49 100644 --- a/src/main/java/com/nis/web/dao/configuration/DdosCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/DdosCfgDao.java @@ -13,4 +13,6 @@ import com.nis.web.dao.MyBatisDao; public interface DdosCfgDao extends CrudDao { List findPage(DdosIpCfg cfg); DdosIpCfg getDdosIpCfg(@Param("cfgId")Long cfgId,@Param("compileId")Integer compileId); + List findByPage(@Param("ids")String ids); + } diff --git a/src/main/java/com/nis/web/dao/configuration/DdosCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/DdosCfgDao.xml index 317b5d16e..0d5bd808f 100644 --- a/src/main/java/com/nis/web/dao/configuration/DdosCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/DdosCfgDao.xml @@ -372,4 +372,19 @@ + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.java b/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.java index e0b0fa891..24a80313b 100644 --- a/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.java @@ -14,4 +14,5 @@ public interface DnsIpCfgDao extends CrudDao { DnsIpCfg getDnsIpCfg(Long cfgId); List findDnsIpCfg(DnsIpCfg entity); List getValidCfgInfo(DnsIpCfg cfg); + List findByPage(@Param("ids")String ids); } diff --git a/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml index 6cb35f3af..9b7429421 100644 --- a/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/DnsIpCfgDao.xml @@ -377,4 +377,21 @@ + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.java b/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.java index 4987aee67..184b63f28 100644 --- a/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.java +++ b/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.java @@ -18,4 +18,6 @@ public interface DnsResStrategyDao extends CrudDao { ,@Param("isAudit")Integer isAudit ,@Param("isValid")Integer isValid); + List findByPage(@Param("ids")String ids); + } \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.xml b/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.xml index e9d200688..8627c300e 100644 --- a/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/DnsResStrategyDao.xml @@ -368,4 +368,21 @@ LEFT JOIN dns_res_strategy r ON a.dns_strategy_id=r.res_group_1_id + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/IpCfgDao.java b/src/main/java/com/nis/web/dao/configuration/IpCfgDao.java index a85073fa8..84a69dc31 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/IpCfgDao.java @@ -46,5 +46,7 @@ public interface IpCfgDao extends CrudDao{ public void updateCfgValid(BaseCfg entity); public void auditCfg(BaseCfg entity); public List getIpCfgList(CfgIndexInfo entity); + + public List getByIdsList(@Param("ids")String ids); } diff --git a/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml index 1334d6e6a..fbcda475f 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml @@ -1143,4 +1143,20 @@ + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.java b/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.java index ac6108ef3..8736baaab 100644 --- a/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.java +++ b/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.java @@ -13,6 +13,10 @@ import com.nis.web.dao.MyBatisDao; @MyBatisDao public interface PxyObjKeyringDao extends CrudDao{ List findPage( PxyObjKeyring pxyObjKeyring); + + List findByList(@Param("ids")String ids); + List findByCertList(@Param("ids")String ids); + List findTrustedCertPage( PxyObjTrustedCaCert PxyObjTrustedCaCert); List findList(@Param("cfgId")Long cfgId ,@Param("isAudit")Integer isAudit diff --git a/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.xml b/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.xml index 0f5f40661..2971e2990 100644 --- a/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/PxyObjKeyringDao.xml @@ -797,4 +797,38 @@ + + + + + + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/service/configuration/AppCfgService.java b/src/main/java/com/nis/web/service/configuration/AppCfgService.java index ceeaeca87..543ddaee9 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -30,6 +30,7 @@ import com.nis.domain.configuration.AppTopicDomainCfg; import com.nis.domain.configuration.AreaIpCfg; import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.BaseStringCfg; +import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.ComplexkeywordCfg; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.NtcSubscribeIdCfg; @@ -94,6 +95,12 @@ public class AppCfgService extends BaseService { return page; } + public List findAppByPolicyList(String ids) { + List list = appCfgDao.findAppByPolicyList(ids); + return list; + } + + public Page findAppIpList(Page page, AppIpCfg entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(), "r")); entity.setPage(page); @@ -101,6 +108,11 @@ public class AppCfgService extends BaseService { page.setList(list); return page; } + + public List findAppByIpList(String ids) { + List list = appCfgDao.findAppByIpList(ids); + return list; + } public Page findAppHttpList(Page page, AppHttpCfg entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(), "r")); @@ -109,6 +121,11 @@ public class AppCfgService extends BaseService { page.setList(list); return page; } + + public List findAppByHttpList(String ids ) { + List list = appCfgDao.findAppByHttpList(ids); + return list; + } public Page findAppDomainList(Page page, AppDomainCfg entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(), "r")); @@ -118,6 +135,11 @@ public class AppCfgService extends BaseService { return page; } + public List findAppByDomainList(String ids) { + List list = appCfgDao.findAppByDomainList(ids); + return list; + } + public AppPolicyCfg exportIpInfo(AppPolicyCfg policy){ List ipPortList = appCfgDao.getAppPolicyIpList(policy); policy.setIpPortList(ipPortList); @@ -136,6 +158,14 @@ public class AppCfgService extends BaseService { page.setList(list); return page; } + + // 主题网站列表 + public List findAppByTopicDomainList(String ids) { + List list = appCfgDao.findAppByTopicDomainList(ids); + return list; + } + + public Page findAppByteList(Page page, AppByteCfg entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(), "r")); @@ -152,6 +182,11 @@ public class AppCfgService extends BaseService { page.setList(list); return page; } + + public List findAppBySslList(String ids) { + List list = appCfgDao.findAppBySslList(ids); + return list; + } public Page findAppTcpList(Page page, AppTcpCfg entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(), "r")); diff --git a/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java b/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java index f474bde23..6af93124f 100644 --- a/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java @@ -60,6 +60,14 @@ public class AppMultiFeatureCfgService extends BaseService { page.setList(list); return page; } + + //分页查询 + public List findAppByFeatureIndexList(String ids) { + List list = appMultiFeatureCfgDao.findAppByFeatureIndexList(ids); + return list; + } + + public AppFeatureIndex getAppFeatureIndex(Long cfgId) { return appMultiFeatureCfgDao.getAppFeatureIndex(cfgId); } diff --git a/src/main/java/com/nis/web/service/configuration/DdosCfgService.java b/src/main/java/com/nis/web/service/configuration/DdosCfgService.java index ac538f437..d5945afe8 100644 --- a/src/main/java/com/nis/web/service/configuration/DdosCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/DdosCfgService.java @@ -62,6 +62,11 @@ public class DdosCfgService extends BaseService{ return page; } + public List findByPage(String ids) { + List list=ddosCfgDao.findByPage(ids); + return list; + } + public DdosIpCfg getDdosIpCfg(Long cfgId,Integer compileId) { return ddosCfgDao.getDdosIpCfg(cfgId,compileId); } diff --git a/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java b/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java index 1355b1401..a30727730 100644 --- a/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/DnsIpCfgService.java @@ -48,6 +48,11 @@ public class DnsIpCfgService extends BaseService{ return page; } + public List findByPage(String ids) { + List list=dnsIpCfgDao.findByPage(ids); + return list; + } + public List findDnsIpCfg(DnsIpCfg entity) { return dnsIpCfgDao.findDnsIpCfg(entity); } diff --git a/src/main/java/com/nis/web/service/configuration/DnsResStrategyService.java b/src/main/java/com/nis/web/service/configuration/DnsResStrategyService.java index b3a002feb..42756bfa0 100644 --- a/src/main/java/com/nis/web/service/configuration/DnsResStrategyService.java +++ b/src/main/java/com/nis/web/service/configuration/DnsResStrategyService.java @@ -52,6 +52,13 @@ public class DnsResStrategyService extends BaseService{ page.setList(list); return page; } + + public List findByPage(String ids ) { + List list=dnsResStrategyDao.findByPage(ids); + return list; + } + + public List findDnsResStrategys(Long cfgId,Integer isValid,Integer isAudit) { List list=dnsResStrategyDao.findList(cfgId,isValid,isAudit); return list; diff --git a/src/main/java/com/nis/web/service/configuration/IpCfgService.java b/src/main/java/com/nis/web/service/configuration/IpCfgService.java index ab964ad43..c7d65241d 100644 --- a/src/main/java/com/nis/web/service/configuration/IpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/IpCfgService.java @@ -932,4 +932,9 @@ public class IpCfgService extends CrudService { return page; } + public List getByIdsList(String ids) { + List list = ipCfgDao.getByIdsList(ids); + return list; + } + } diff --git a/src/main/java/com/nis/web/service/configuration/PxyObjKeyringService.java b/src/main/java/com/nis/web/service/configuration/PxyObjKeyringService.java index 97ce21885..6f99c3755 100644 --- a/src/main/java/com/nis/web/service/configuration/PxyObjKeyringService.java +++ b/src/main/java/com/nis/web/service/configuration/PxyObjKeyringService.java @@ -56,6 +56,17 @@ public class PxyObjKeyringService extends BaseService{ page.setList(list); return page; } + public List findByList(String ids) { + List list=pxyObjKeyringDao.findByList(ids); + return list; + } + + public List findByCertList(String ids) { + List list=pxyObjKeyringDao.findByCertList(ids); + return list; + } + + /** * 查询分页数据 * @param page 分页对象 diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 9c188c01b..a06cbaddf 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -1375,4 +1375,20 @@ pps_percent=pps Percent spoofing_ip_object=Spoofing Policy Object spoofing_ip_policy=Spoofing Policy action_spoofing=Spoofing -spoofing=spoofing \ No newline at end of file +spoofing=spoofing +service=Service +s_asn=SASN +d_asn=DASN +asn_conn_report=ANS Report +https_url_report=HTTP(s) URL Report +url=URL +sum=SUM +url_count=URL Count +ip_range_report=ip Range Report +ip_start=Start IP +ip_end=End IP +ip_start_num=IP Start Num +ip_end_num=IP End Num +ip_sub=IP Subnet +start_ip=Start IP +end_ip=End IP \ No newline at end of file diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 76a98c4e3..fc79fb8cf 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -1379,4 +1379,20 @@ pps_percent=pps Percent spoofing_ip_object=Spoofing Policy Object spoofing_ip_policy=Spoofing Policy action_spoofing=Spoofing -spoofing=spoofing \ No newline at end of file +spoofing=spoofing +service=Service +s_asn=SASN +d_asn=DASN +asn_conn_report=ANS Report +https_url_report=HTTP(s) URL Report +url=URL +sum=SUM +url_count=URL Count +ip_range_report=ip Range Report +ip_start=Start IP +ip_end=End IP +ip_start_num=IP Start Num +ip_end_num=IP End Num +ip_sub=IP Subnet +start_ip=Start IP +end_ip=End IP \ No newline at end of file diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index 4393ce687..f60cca46b 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -1375,4 +1375,20 @@ pps_percent=pps Percent spoofing_ip_object=Spoofing Policy Object spoofing_ip_policy=Spoofing Policy action_spoofing=Spoofing -spoofing=spoofing \ No newline at end of file +spoofing=spoofing +service=Service +s_asn=SASN +d_asn=DASN +asn_conn_report=ANS Report +https_url_report=HTTP(s) URL Report +url=URL +sum=SUM +url_count=URL Count +ip_range_report=ip Range Report +ip_start=Start IP +ip_end=End IP +ip_start_num=IP Start Num +ip_end_num=IP End Num +ip_sub=IP Subnet +start_ip=Start IP +end_ip=End IP \ No newline at end of file diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index cca95a773..3264764e6 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -589,4 +589,7 @@ ntcConnRecordPercent=ntcConnRecordPercent #\u5BFC\u51FA\u6700\u5927\u6761\u6570 maxLogExportSize=2000 pxy_crtl_subscribe_id_region=PXY_CTRL_SUBSCRIBE_ID -ntc_subscribe_id_region=NTC_SUBSCRIBE_ID \ No newline at end of file +ntc_subscribe_id_region=NTC_SUBSCRIBE_ID +ntcAsnRecord=ntcAsnRecord +ntcURLReport=ntcURLReport +ntcIpRangeReport=ntcIpRangeReport \ No newline at end of file diff --git a/src/main/resources/sql/20181216/add_data_dictionary_item.sql b/src/main/resources/sql/20181216/add_data_dictionary_item.sql new file mode 100644 index 000000000..eb5a853b5 --- /dev/null +++ b/src/main/resources/sql/20181216/add_data_dictionary_item.sql @@ -0,0 +1,7 @@ +#日志查询-封堵类型 +INSERT INTO `sys_data_dictionary_name` (`id`, `module_name`, `mark`, `remark`, `revision`, `create_time`, `modify_time`, `status`) VALUES ('152', '日志查询-封堵类型', 'FD_TYPE', '日志查询-封堵类型', '', '2018-12-17 06:06:23', '2018-12-17 06:06:23', '1'); + + +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('4059', '0', 'black_block_list', '动态黑名单FD', '0', '1', '1', '152'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('4060', '1', 'static_cfg_block', '静态配置FD', '0', '1', '1', '152'); +INSERT INTO `sys_data_dictionary_item` (`id`, `item_code`, `item_value`, `item_desc`, `item_sort`, `status`, `type`, `dictionary_id`) VALUES ('4061', '2', 'first_hit', '首次分析命中', '0', '1', '1', '152'); diff --git a/src/main/webapp/WEB-INF/tags/sys/delRow.tag b/src/main/webapp/WEB-INF/tags/sys/delRow.tag index 911c24199..9a98ad502 100644 --- a/src/main/webapp/WEB-INF/tags/sys/delRow.tag +++ b/src/main/webapp/WEB-INF/tags/sys/delRow.tag @@ -31,12 +31,12 @@ - + - + diff --git a/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp b/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp index c60ba36cc..21858d0ec 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/dashBoardIndex.jsp @@ -196,7 +196,7 @@
-   <%-- --%> +   
diff --git a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp index 2c46ff8b1..32a6e3ac6 100644 --- a/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp +++ b/src/main/webapp/WEB-INF/views/dashboard/trafficWebTypeList.jsp @@ -3,118 +3,185 @@ 网站主题服务分类 - + + + + + + + + + + + - + -
- -

- -

- - --%> + <%-- --%> - - - - - - - - - -
- -
-
-
- -
- - - - -
- - - -
- - - - - -<%-- --%> - - - - - - - - - - + + + +
+
+
+ +
+ + + + +
+ + + + +
+
+ - - -<%-- --%> - - - - - - + + + + + + + - - -
${entry.id }${entry.ipAddr }${entry.areaId }${entry.linkNum }${entry.c2sPktNum }${entry.s2cPktNum }${entry.c2sByteLen }${entry.s2cByteLen }
-
${page}
-
-
+ + + + +
+
+
+
+    + +
+
+ <%--

 1 @@ -132,70 +199,361 @@ 33456 +
+
  
+

--%>
-
- - + + function chartData(websiteId) { + loading(); + $ + .ajax({ + url : '${ctx}/dashboard/traffic/websiteChart', + type : 'get', + dataType : "json", + data : { + "websiteId" : websiteId + }, + async : false, + timeout : 10000, + success : function(data) { + if (data != null && data.length > 0 + && data[0].error != null) { + top.$.jBox + .tip( + "", + ""); + return; + } + webTypeChart(data); + }, + error : function(data, textStatus, errorThrown) { + closeTip(); + }, + complete : function(XMLHttpRequest, status) {//超时设置 + closeTip(); + } + }); + } + /** + * 分页控件处理 + */ + function pageJuan(showData) { + if (typeof (fileData) != "undefined" && fileData != null) { + var totalData = fileData.length; + // var showData = 10; + if (showData > totalData) { + showData = totalData; + } + $('.M-box').pagination({ + totalData : totalData, + showData : showData, + coping : true, + callback : function(index) { + //改变显示开始和结束数据编号 + getPageData(index.getCurrent(), showData); + } + }); + } + } + // 比例协议统计图 + /* function webTypeChart(rs){ + //终端用户 分操作系统与浏览器 + var data=new Array(); + $(rs).each(function(i, d) { + data.push({ + name: d.website, + y: d.count, + }); + }); + // 创建图例 + var chart = Highcharts.chart('chart',{ + chart: { + plotBackgroundColor:null, + plotBorderWidth:null, + plotShadow:false, + type: 'pie' + }, + navigation: { + buttonOptions: { + x:-25, + } + }, + exporting: { + allowHTML:true, + filename:"Website", + scale:1, + sourceWidth: 1280, + sourceHeight: 500, + }, + noData:{ + style: {//设置字体颜色 + color: '#000', + }, + }, + // legend:{// 底部平鋪图例 + // width:1280, + // x:40, + // itemWidth:100, + // itemDistance:2, + // itemHoverStyle:{ + // color:'#61D2F7', + // }, + // }, + legend: { + // layout: 'vertical', + align: 'right', + verticalAlign: 'middle', + width:380, + itemWidth:100, + itemDistance:2, + itemHoverStyle:{ + color:'#61D2F7', + }, + }, + // colors:['#f36f8a', '#44A9A8', '#ffff43','#25f3e6','#964CEC','#32B0ED','#2b6ed7','#7278DD','#2DA9D8','#C66FE6'], + title: { + text: null, + }, + plotOptions: { + series: { + dataLabels: { + enabled: true, + softConnector: true, // 是否使用曲线 + formatter: function () { + // 通过函数判断是否显示数据标签,为了防止数据标签过于密集 + return this.percentage > 1 ? '' + this.point.name + ' : ' +this.percentage.toFixed(2)+' %' : null; + }, + style: { + color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black' + } + }, + }, + pie:{ + allowPointSelect: true, + showInLegend: true, + point: { + events: { + mouseOver: function(e) { + this.slice(); + }, + // 鼠标移出时,收回突出显示 + mouseOut: function() { + this.slice(); + }, + // 默认是点击突出,这里屏蔽掉 + click: function() { + return false; + } + }, + }, + } + }, + credits:{//是否有highcharts水印 + enabled:false + }, + tooltip: { + headerFormat: '{series.name}
', + pointFormat: '{point.name}: {point.percentage:.2f}%' + }, + series: [{ + name: "Website", + colorByPoint: true, + data: data + }], + }); + } */ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/log/manipulation/dkBehaviorList.jsp b/src/main/webapp/WEB-INF/views/log/manipulation/dkBehaviorList.jsp index 01193ded9..67c8d7358 100644 --- a/src/main/webapp/WEB-INF/views/log/manipulation/dkBehaviorList.jsp +++ b/src/main/webapp/WEB-INF/views/log/manipulation/dkBehaviorList.jsp @@ -143,12 +143,21 @@ $(document).ready(function(){
-
+
+ + +
+ href="javascript:;"> + + +
@@ -223,46 +232,46 @@ $(document).ready(function(){ - - - - + + + + - + - + <%-- --%> - + <%-- --%> - + <%-- --%> - - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/views/log/ntc/bgpList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/bgpList.jsp index 539bab8d8..b421a5d48 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/bgpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/bgpList.jsp @@ -127,6 +127,16 @@
- +
+
+ + +
+ href="javascript:;"> + + +
@@ -141,36 +151,36 @@ $(document).ready(function(){ - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + - Contacts - Via - Route - Record Route - User Agent - Server + Contacts + Via + Route + Record Route + User Agent + Server diff --git a/src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp index 93986e79f..fe2bab624 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/connRecordLogList.jsp @@ -141,12 +141,22 @@ - +
+
+ + +
+ href="javascript:;"> + + +
@@ -229,42 +239,44 @@ <%-- --%> - - - + + + - - - - Total Pkt - - - Total Byte - - - - - - - - - - - - - - + + + + Total Pkt + + + Total Byte - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp index 44986de78..e647fcc57 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/ddosList.jsp @@ -133,6 +133,16 @@ $(document).ready(function(){ - +
+
+ + +
+ href="javascript:;"> + + +
@@ -212,40 +222,40 @@ $(document).ready(function(){ - - - - - + + + + + - - - + + - - - - - - + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp index 3c1115c31..f80f80425 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/httpKeyList.jsp @@ -154,9 +154,16 @@
+
+ + +
href="javascript:;"> @@ -208,45 +218,45 @@ $(document).ready(function(){ - - - - - + + + + + - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + <%-- --%> - - - + + + - - - - - - - - - + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp index 01b4c6b2f..f048d9f3e 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp @@ -132,6 +132,16 @@ $(document).ready(function(){ - - - - + + + + - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + <%-- --%> - - - + + + - - - - - - - - - + + + + + + + + + @@ -310,9 +320,14 @@ $(document).ready(function(){ - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmVoipIpList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmVoipIpList.jsp index 6cfc3834e..4aea70802 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmVoipIpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmVoipIpList.jsp @@ -131,12 +131,22 @@ $(document).ready(function(){ - +
+
+ + +
+ href="javascript:;"> + + +
@@ -210,54 +220,55 @@ $(document).ready(function(){ - - - - + + + + + - - - - - - - - + + + + + + - - - - + + + + - - - - + + + + - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/views/log/ntc/ntcStreamMedia.jsp b/src/main/webapp/WEB-INF/views/log/ntc/ntcStreamMedia.jsp index e8f93d40a..876bece24 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/ntcStreamMedia.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/ntcStreamMedia.jsp @@ -130,12 +130,22 @@ $(document).ready(function(){ - +
+
+ + +
+ href="javascript:;"> + + +
@@ -209,38 +219,40 @@ $(document).ready(function(){ - - - - + + + + + - - - - - - - - - - - - - - - - - + + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/views/log/ntc/p2pList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/p2pList.jsp index 228e654c4..ca795e7b7 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/p2pList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/p2pList.jsp @@ -127,6 +127,16 @@ - - - - + + + + + - + + + - - - - - - - - - - - - - - - - - + + + + + + + - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/views/log/ntc/sslLogList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/sslLogList.jsp index be098f2f9..ed2af9ea0 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/sslLogList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/sslLogList.jsp @@ -144,12 +144,21 @@ +
+ + +
+ href="javascript:;"> + + + @@ -224,41 +233,43 @@ - - - - + + + + + - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/views/log/pxy/pxyHttpList.jsp b/src/main/webapp/WEB-INF/views/log/pxy/pxyHttpList.jsp index 50ab52e98..f3bc5a5e0 100644 --- a/src/main/webapp/WEB-INF/views/log/pxy/pxyHttpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/pxy/pxyHttpList.jsp @@ -113,6 +113,16 @@ - - - - + + + + - + - - + + - - - - - - - - + + + + + + + + <%-- --%> - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp b/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp new file mode 100644 index 000000000..5a6b915b8 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/report/asnRecordList.jsp @@ -0,0 +1,124 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + <spring:message code="asn_conn_report"/> + + + + + +
+ +

+ +

+ +
+
+
+
+ + + + +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ + +
+ +
+ + +
+
+ +
+ +
${log.level} - - - + ${log.fdType } + + + ${dic.itemValue} + + + + diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVoipList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVoipList.jsp index 0fec691b1..92fec55ff 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVoipList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVoipList.jsp @@ -131,6 +131,16 @@ $(document).ready(function(){
SNISANCNSNISANCN
URL        
+ + + <%-- --%> + <%-- + --%> + + + + + + + + + + <%-- --%> + + + + + + + + +
+ + + ${log.bps }${log.pps }${log.sAsn}${log.dAsn}
+
${page}
+
+ + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/ipRangeReportList.jsp b/src/main/webapp/WEB-INF/views/report/ipRangeReportList.jsp new file mode 100644 index 000000000..6d5328d6f --- /dev/null +++ b/src/main/webapp/WEB-INF/views/report/ipRangeReportList.jsp @@ -0,0 +1,154 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + <spring:message code="ip_range_report"/> + + + + + +
+ +

+ +

+ +
+
+
+
+ + + + +
+
+
+
+ +
+
+
+
+
+
+ + + + + + +
+
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+ +
+ + +
+ +
+ + +
+
+ +
+ + + + + <%-- --%> + <%-- + --%> + + + + + + + + + + + <%-- --%> + + + + + + + + +
+ + + ${log.ipStart }${log.ipEnd }${log.ipStartNum}${log.ipEndNum}${log.ipSub}
+
${page}
+
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/report/urlReportList.jsp b/src/main/webapp/WEB-INF/views/report/urlReportList.jsp new file mode 100644 index 000000000..8391d8b91 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/report/urlReportList.jsp @@ -0,0 +1,165 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + <spring:message code="https_url_report"/> + + + + + +
+ +

+ +

+ +
+
+
+
+ + + + +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+ +
+ +
+
+
+ + +
+ +
+ + +
+
+ +
+ + + + + <%-- --%> + <%-- + --%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
${log.url }${log.urlCount}
${log.url }${ips.ipAddr }${ips.sum}${log.urlCount}
+
${page}
+
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/static/pages/scripts/echart.js b/src/main/webapp/static/pages/scripts/echart.js index 833b14a9c..2feb56f24 100644 --- a/src/main/webapp/static/pages/scripts/echart.js +++ b/src/main/webapp/static/pages/scripts/echart.js @@ -1,4 +1,15 @@ - + Highcharts.setOptions({ // Apply to all charts + chart: { + events: { + beforePrint: function () { + $(".highcharts-background").attr("fill","rgba(48,48,48,1)") + }, + afterPrint: function () { + $(".highcharts-background").attr("fill","rgba(255, 255, 255, 0)") + } + } + } + }); //协议统计分析 function echart_1(rs) { @@ -340,7 +351,7 @@ name: ' ', colorByPoint: true, data: data - }], + }] // drilldown:{ // activeAxisLabelStyle:{ // textDecoration:'none',