通联日志 检索条件添加和字段属性添加
This commit is contained in:
@@ -1,45 +1,31 @@
|
||||
package com.nis.web.controller.log.ntc;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.eclipse.jetty.util.ajax.JSON;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.JsonObject;
|
||||
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;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.CodeDicUtils;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DictUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
@@ -63,11 +49,40 @@ public class NtcConnRecordLogController extends BaseController {
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
initLogSearchValue(log, params);
|
||||
|
||||
if (StringUtils.isNotBlank(log.getAppId())) {
|
||||
params.put("searchAppId", log.getAppId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getProtoId())) {
|
||||
params.put("searchProtoId", log.getProtoId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getWebId())) {
|
||||
params.put("searchWebId", log.getWebId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getsAsn())) {
|
||||
params.put("searchSAsn", log.getsAsn());
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getdAsn())) {
|
||||
params.put("searchDAsn", log.getdAsn());
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getServerLocate())) {
|
||||
params.put("searchServerLocate", log.getServerLocate());
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getClientLocate())) {
|
||||
params.put("searchClientLocate", log.getClientLocate());
|
||||
}
|
||||
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
List<CodeResult> appList = CodeDicUtils.getCodeList("appCode");
|
||||
List<CodeResult> protocolList = CodeDicUtils.getCodeList("protocolCode");
|
||||
List<CodeResult> webList = CodeDicUtils.getCodeList("webCode");
|
||||
|
||||
model.addAttribute("appList", appList);
|
||||
model.addAttribute("protocolList", protocolList);
|
||||
model.addAttribute("webList", webList);
|
||||
model.addAttribute("appList", appList);
|
||||
model.addAttribute("protocolList", protocolList);
|
||||
model.addAttribute("webList", webList);
|
||||
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_CONN_RECORD_LOG;
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
@@ -148,10 +163,36 @@ public class NtcConnRecordLogController extends BaseController {
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
initLogSearchValue(log, params);
|
||||
|
||||
if (StringUtils.isNotBlank(log.getAppId())) {
|
||||
params.put("searchAppId", log.getAppId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getProtoId())) {
|
||||
params.put("searchProtoId", log.getProtoId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getWebId())) {
|
||||
params.put("searchWebId", log.getWebId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getsAsn())) {
|
||||
params.put("searchSAsn", log.getsAsn());
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getdAsn())) {
|
||||
params.put("searchDAsn", log.getdAsn());
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getServerLocate())) {
|
||||
params.put("searchServerLocate", log.getServerLocate());
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getClientLocate())) {
|
||||
params.put("searchClientLocate", log.getClientLocate());
|
||||
}
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
|
||||
List<CodeResult> appList = CodeDicUtils.getCodeList("appCode");
|
||||
List<CodeResult> protocolList = CodeDicUtils.getCodeList("protocolCode");
|
||||
List<CodeResult> webList = CodeDicUtils.getCodeList("webCode");
|
||||
model.addAttribute("appList", appList);
|
||||
model.addAttribute("protocolList", protocolList);
|
||||
model.addAttribute("webList", webList);
|
||||
Properties msgProp = getMsgProp();
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_CONN_RECORD_LOG;
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
List<NtcConnRecordLog> list = new ArrayList<NtcConnRecordLog>();
|
||||
@@ -166,8 +207,21 @@ public class NtcConnRecordLogController extends BaseController {
|
||||
}
|
||||
}
|
||||
for (NtcConnRecordLog l : list) {
|
||||
l.setFunctionId(log.getFunctionId());
|
||||
setLogAction(l, serviceList);
|
||||
if (StringUtils.isNotBlank(l.getAppId())) {
|
||||
l.setAppId(getName(l.getAppId(),appList,msgProp));
|
||||
}
|
||||
if (StringUtils.isNotBlank(l.getProtoId())) {
|
||||
l.setProtoId(getName(l.getProtoId(),protocolList,msgProp));
|
||||
}
|
||||
if (StringUtils.isNotBlank(l.getWebId())) {
|
||||
l.setWebId(getName(l.getWebId(),webList,msgProp));
|
||||
}
|
||||
if (StringUtils.isNotBlank(l.getC2sPktNum()) && StringUtils.isNotBlank(l.getS2cPktNum()) ) {
|
||||
l.setTotalPkt(String.valueOf(Integer.valueOf(l.getC2sPktNum())+Integer.valueOf(l.getS2cPktNum())));
|
||||
}
|
||||
if (StringUtils.isNotBlank(l.getC2sByteNum()) && StringUtils.isNotBlank(l.getS2cByteNum()) ) {
|
||||
l.setTotalByte(String.valueOf(Integer.valueOf(l.getC2sByteNum())+Integer.valueOf(l.getS2cByteNum())));
|
||||
}
|
||||
}
|
||||
titleList.add("conn_record");
|
||||
classMap.put("conn_record", NtcConnRecordLog.class);
|
||||
@@ -177,7 +231,7 @@ public class NtcConnRecordLogController extends BaseController {
|
||||
} else {
|
||||
hColumns += ",";
|
||||
}
|
||||
String cfgIndexInfoNoExport = ",cfg_id,action," + hColumns;
|
||||
String cfgIndexInfoNoExport = ",cfg_id,action,user_region," + hColumns;
|
||||
noExportMap.put("conn_record", cfgIndexInfoNoExport);
|
||||
dataMap.put("conn_record", list);
|
||||
String timeRange= initLogMap(log,"conn_record");
|
||||
@@ -195,5 +249,16 @@ public class NtcConnRecordLogController extends BaseController {
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
}
|
||||
|
||||
public String getName(String id,List<CodeResult> list,Properties msgProp){
|
||||
String name=String.valueOf(id);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user