增加通联关系日志

ddos增加action检索条件
This commit is contained in:
段冬梅
2018-12-15 16:09:34 +08:00
parent 23a560563a
commit 6aa6b83eab
9 changed files with 502 additions and 7 deletions

View File

@@ -0,0 +1,79 @@
package com.nis.web.controller.log.ntc;
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 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.IrDnatLog;
import com.nis.domain.log.IrSnatLog;
import com.nis.domain.log.NtcCollectRadiusLog;
import com.nis.domain.log.NtcConnRecordLog;
import com.nis.domain.maat.LogRecvData;
import com.nis.util.CodeDicUtils;
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.dao.dashboard.codedic.CodeResult;
@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) {
try {
PageLog<NtcConnRecordLog> page = new PageLog<NtcConnRecordLog>(request, response);
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());
model.addAttribute("serviceList", serviceList);
List<CodeResult> appList=CodeDicUtils.getCodeList("appCode");
model.addAttribute("appList", appList);
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<NtcConnRecordLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcConnRecordLog>>(){}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcConnRecordLog> data = fromJson.getData();
page.setCount(data.getCount());
page.setLast(data.getLast());
page.setList(data.getList());
/*List<NtcCollectRadiusLog> 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 "/log/ntc/connRecordLogList";
}
}