业务配置ip白名单导出,导出后与界面展示字段不一样,已调整
This commit is contained in:
@@ -130,9 +130,7 @@ public class ExcelCsv {
|
||||
Map<String, List<String>> commentMap=new HashMap<String, List<String>>();
|
||||
for (String title : titleList) {
|
||||
String noExportField=noExportMap.get(title);
|
||||
if(noExportField.contains("do_log")){
|
||||
noExportField=",do_blacklist,"+noExportField;
|
||||
}
|
||||
noExportField=",do_blacklist,"+noExportField;
|
||||
List<Object[]> annotationList = Lists.newArrayList();
|
||||
List<Field> list=new ArrayList<Field>();
|
||||
// Get annotation field
|
||||
|
||||
@@ -2406,9 +2406,7 @@ public class ExportExcel {
|
||||
Map<String, List<String>> commentMap=new HashMap<String, List<String>>();
|
||||
for (String title : titleList) {
|
||||
String noExportField=noExportMap.get(title);
|
||||
if(noExportField.contains("do_log")){
|
||||
noExportField=",do_blacklist,"+noExportField;
|
||||
}
|
||||
noExportField=",do_blacklist,"+noExportField;
|
||||
List<Object[]> annotationList = Lists.newArrayList();
|
||||
List<Field> list=new ArrayList<Field>();
|
||||
// Get annotation field
|
||||
|
||||
@@ -369,11 +369,40 @@ public class WhiteListController extends CommonController {
|
||||
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
|
||||
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
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
if(cfg.getIsAudit()!=0){
|
||||
set.add(cfg.getServiceId());
|
||||
compileIds.append(cfg.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", cfg.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
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);
|
||||
}
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_IP");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
String cfgIndexInfoNoExport = ",log_total,policy_name,do_log,letter,whether_area_block,classification,attribute,label,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String cfgIndexInfoNoExport = ",policy_name,letter,whether_area_block,classification,attribute,label,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport = ",protocol,direction,do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
@@ -397,6 +426,12 @@ public class WhiteListController extends CommonController {
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
CfgIndexInfo cfgIndexInfo = ipCfgService.exportIpInfo(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user