日志导出数据最大提示调整
Stream导出优化
This commit is contained in:
@@ -14,13 +14,11 @@ import com.wordnik.swagger.annotations.ApiModelProperty;
|
||||
*/
|
||||
public class DkBehaviorLog extends BaseLogEntity<DkBehaviorLog> {
|
||||
private static final long serialVersionUID = -589390375816690510L;
|
||||
@ExcelField(title="basic_protocol",sort=8)
|
||||
|
||||
protected Integer labelProtoId; //协议类型id
|
||||
protected Integer labelOsId;//操作系统id
|
||||
protected Integer labelBsId; //浏览器id
|
||||
@ExcelField(title="behaviour_type",sort=9)
|
||||
protected Integer labelBehavId; //行为id
|
||||
@ExcelField(title="social_app",sort=10)
|
||||
protected Integer labelAppId; //应用id
|
||||
protected Integer labelProtoSource; //应用id
|
||||
protected Integer labelBehavSource; //应用id
|
||||
@@ -34,8 +32,32 @@ public class DkBehaviorLog extends BaseLogEntity<DkBehaviorLog> {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ 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;
|
||||
@@ -26,8 +27,6 @@ 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.log.DkBehaviorLog;
|
||||
import com.nis.domain.maat.LogRecvData;
|
||||
import com.nis.util.CodeDicUtils;
|
||||
import com.nis.util.Constants;
|
||||
@@ -109,7 +108,7 @@ public class DkBehaviorLogController extends BaseController{
|
||||
|
||||
// Stream配置导出
|
||||
@RequestMapping(value = "exportStream")
|
||||
public void exportStream(@ModelAttribute("log") DkBehaviorLog log, Model model, String hColumns, String type,
|
||||
public void exportStream(@ModelAttribute("log") DkBehaviorLog entry, Model model, String hColumns, String type,
|
||||
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
||||
String name= "Stream";
|
||||
try {
|
||||
@@ -120,39 +119,60 @@ public class DkBehaviorLogController extends BaseController{
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
// ---------------------------
|
||||
PageLog<DkBehaviorLog> page = new PageLog<DkBehaviorLog>(request, response);
|
||||
Map<String, Object> params=new HashMap<>();
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
if(StringUtil.isEmpty(entry.getAction())){
|
||||
for(int i=0;i<serviceList.size();i++){
|
||||
if(serviceList.get(i).getServiceId()!=32 && serviceList.get(i).getServiceId()!=128){
|
||||
entry.setAction(serviceList.get(i).getAction());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
page.setPageNo(1);
|
||||
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
initLogSearchValue(log, params);
|
||||
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId());
|
||||
System.out.print(log.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
//查询值判断
|
||||
initLogSearchValue(entry,params);
|
||||
|
||||
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_DKBEHAVIOR_LOG;
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
List<DkBehaviorLog> list = new ArrayList<DkBehaviorLog>();
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
LogRecvData<DkBehaviorLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<DkBehaviorLog>>() {
|
||||
}.getType());
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
//获取字典信息
|
||||
List<CodeResult> protocolList=CodeDicUtils.getCodeList("protocolCode");
|
||||
List<CodeResult> behaviorList=CodeDicUtils.getCodeList("behaviorCode");
|
||||
List<CodeResult> 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<DkBehaviorLog> fromJson = gson.fromJson(jsonString, new TypeToken<LogRecvData<DkBehaviorLog>>(){}.getType());
|
||||
List<DkBehaviorLog> list=new ArrayList<DkBehaviorLog>();
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
Page<DkBehaviorLog> data = fromJson.getData();
|
||||
list = data.getList();
|
||||
}
|
||||
}
|
||||
for (DkBehaviorLog l : list) {
|
||||
l.setFunctionId(log.getFunctionId());
|
||||
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(log.getFunctionId()==407){
|
||||
if(entry.getFunctionId()==407){
|
||||
hColumns+=",behaviour_type,";
|
||||
name="protocol_identify";
|
||||
}else if(log.getFunctionId()==63){
|
||||
}else if(entry.getFunctionId()==63){
|
||||
name="social_app_control";
|
||||
}else if(log.getFunctionId()==408){
|
||||
}else if(entry.getFunctionId()==408){
|
||||
name="encrypted_tunnel_behavior";
|
||||
}
|
||||
titleList.add(name);
|
||||
@@ -180,5 +200,16 @@ public class DkBehaviorLogController extends BaseController{
|
||||
}
|
||||
}
|
||||
|
||||
public String getName(Integer id,List<CodeResult> 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,12 +31,12 @@
|
||||
</a>
|
||||
</c:when>
|
||||
<c:when test="${label eq 'excel'}">
|
||||
<a href="javascript:void(0);" onclick="exportData('${url}',${fns:getStringProperty('maxExportSize',1000000)},'${searchUrl}')" data-toggle="tooltip" data-placement="top">
|
||||
<a href="javascript:void(0);" onclick="exportData('${url}',${fns:getStringProperty('maxLogExportSize',2000)},'${searchUrl}')" data-toggle="tooltip" data-placement="top">
|
||||
<i class="fa fa-download"> <spring:message code="Excel"/></i>
|
||||
</a>
|
||||
</c:when>
|
||||
<c:when test="${label eq 'csv'}">
|
||||
<a href="javascript:void(0);" onclick="exportData('${url}',${fns:getStringProperty('maxExportSize',1000000)},'${searchUrl}')" data-toggle="tooltip" data-placement="top">
|
||||
<a href="javascript:void(0);" onclick="exportData('${url}',${fns:getStringProperty('maxLogExportSize',2000)},'${searchUrl}')" data-toggle="tooltip" data-placement="top">
|
||||
<i class="fa fa-download"> <spring:message code="CSV"/></i>
|
||||
</a>
|
||||
</c:when>
|
||||
|
||||
Reference in New Issue
Block a user