修复bug:

1.区域阻断范围字段导出数据与界面上显示不一致,界面上显示全部、导出的excel字段显示为否
2.界面上存在日志总量字段,导出的数据中不存在
3.导出数据包含字段blacklist option,界面上不存在
This commit is contained in:
wangwenrui
2019-01-14 10:52:06 +08:00
parent 3fb8d8c6f2
commit e7c7a4b960
17 changed files with 692 additions and 18 deletions

View File

@@ -4,8 +4,10 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -1706,13 +1708,35 @@ public class AppCfgController extends BaseController {
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
ipLists = page.getList();
}
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
StringBuilder compileIds=new StringBuilder(",");
Set<Integer> set=new HashSet<Integer>();
for (AppPolicyCfg policy : ipLists) {
if(policy.getIsAudit()!=0){
set.add(policy.getServiceId());
compileIds.append(policy.getCompileId()+",");
}else{
Map<String,Object> logTotal=new HashMap<String,Object>();
logTotal.put("compileId", policy.getCompileId()+"");
logTotal.put("sum",0L);
logTotals.add(logTotal);
}
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId());
if (app != null) {
policy.setSocialName(app.getSpecServiceName());
}
}
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);
}
// 查找社交应用的所有有效二级特定服务
SpecificServiceCfg second = new SpecificServiceCfg();
for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) {
@@ -1726,6 +1750,12 @@ public class AppCfgController extends BaseController {
List<SpecificServiceCfg> secondList = specificServiceCfgService.findAllSpecificServiceCfg(second, null);
// 遍历,找到匹配项后将行为设置进去
for (AppPolicyCfg policy : ipLists) {
for (Map<String,Object> logTotal : logTotals) {
if(policy.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
policy.setTotalLogs((Long)logTotal.get("sum"));
break;
}
}
if (policy.getBehavCode() == null)
continue;
for (SpecificServiceCfg secondCfg : secondList) {
@@ -1743,7 +1773,7 @@ public class AppCfgController extends BaseController {
classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class);
classMap.put("NTC_IP", IpPortCfg.class);
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
String cfgIndexInfoNoExport = ",encrypted_tunnel_behavior,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
String cfgIndexInfoNoExport = ",do_blacklist,encrypted_tunnel_behavior,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
String ipPortInfoNoExport = ",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"