国家代理控制策略下所有界面 修复导出日志总量无数据问题
This commit is contained in:
@@ -3,9 +3,11 @@ package com.nis.web.controller.configuration.proxy;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@@ -295,9 +297,27 @@ public class HttpRedirectPolicyController extends BaseController {
|
|||||||
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity);
|
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity);
|
||||||
ipLists = page.getList();
|
ipLists = page.getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//日志总量
|
||||||
|
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||||
|
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||||
|
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||||
|
|
||||||
|
|
||||||
Properties prop = getMsgProp();
|
Properties prop = getMsgProp();
|
||||||
for (CfgIndexInfo str : ipLists) {
|
for (CfgIndexInfo str : ipLists) {
|
||||||
|
|
||||||
|
if(str.getIsAudit()!=0){
|
||||||
|
set.add(str.getServiceId());
|
||||||
|
compileIds.append(str.getCompileId()+",");
|
||||||
|
}else{
|
||||||
|
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||||
|
logTotal.put("compileId", str.getCompileId()+"");
|
||||||
|
logTotal.put("sum",0L);
|
||||||
|
logTotals.add(logTotal);
|
||||||
|
}
|
||||||
|
|
||||||
if (entity.getFunctionId() != 210 && entity.getFunctionId() != 211) {
|
if (entity.getFunctionId() != 210 && entity.getFunctionId() != 211) {
|
||||||
String type = "RESPONSE_CODE";
|
String type = "RESPONSE_CODE";
|
||||||
if (entity.getFunctionId() == 207) {
|
if (entity.getFunctionId() == 207) {
|
||||||
@@ -324,6 +344,21 @@ public class HttpRedirectPolicyController extends BaseController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//获取日志总量
|
||||||
|
StringBuilder serviceIds=new StringBuilder(",");
|
||||||
|
if(set.size()>0) {
|
||||||
|
for (Integer id : set) {
|
||||||
|
serviceIds.append(id+",");
|
||||||
|
}
|
||||||
|
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||||
|
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||||
|
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||||
|
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||||
|
logTotals.addAll(logs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||||
if (entity.getFunctionId() == 207) {
|
if (entity.getFunctionId() == 207) {
|
||||||
cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:response_code-userregion2:response_content-";
|
cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:response_code-userregion2:response_content-";
|
||||||
@@ -393,6 +428,14 @@ public class HttpRedirectPolicyController extends BaseController {
|
|||||||
httpResBodyList.addAll(maps.get("NTC_HTTP_RES_BODY"));
|
httpResBodyList.addAll(maps.get("NTC_HTTP_RES_BODY"));
|
||||||
ipPortList.addAll(maps.get("NTC_UNIVERSAL_IP"));
|
ipPortList.addAll(maps.get("NTC_UNIVERSAL_IP"));
|
||||||
subscribeIdList.addAll(maps.get("NTC_SUBSCRIBE_ID"));
|
subscribeIdList.addAll(maps.get("NTC_SUBSCRIBE_ID"));
|
||||||
|
|
||||||
|
for (Map<String,Object> logTotal : logTotals) {
|
||||||
|
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||||
|
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
httpUrlList = BaseStringCfg.replaceBaseKeyList(httpUrlList);
|
httpUrlList = BaseStringCfg.replaceBaseKeyList(httpUrlList);
|
||||||
httpReqHdrList = ComplexkeywordCfg.replaceComplexKeyList(httpReqHdrList);
|
httpReqHdrList = ComplexkeywordCfg.replaceComplexKeyList(httpReqHdrList);
|
||||||
|
|||||||
Reference in New Issue
Block a user