Merge branch 'develop' of http://192.168.10.125/k18_web/NFS.git into develop

This commit is contained in:
default
2018-12-17 09:55:37 +08:00
124 changed files with 5661 additions and 1712 deletions

View File

@@ -1617,20 +1617,20 @@ public class AppCfgController extends BaseController {
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<AppPolicyCfg> ipLists=new ArrayList<AppPolicyCfg>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=appCfgService.findAppByPolicyList(ids);
}else{
entity.setTableName(IpPortCfg.getTablename());
Page<AppPolicyCfg> pageInfo=new Page<AppPolicyCfg>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<AppPolicyCfg> pageInfo=new Page<AppPolicyCfg>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
for(AppPolicyCfg policy:page.getList()){
for(AppPolicyCfg policy:ipLists){
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId());
if(app!=null) {
policy.setSocialName(app.getSpecServiceName());
@@ -1648,7 +1648,7 @@ public class AppCfgController extends BaseController {
second.setIsLeaf(1);
List<SpecificServiceCfg> secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null);
//遍历,找到匹配项后将行为设置进去
for(AppPolicyCfg policy:page.getList()){
for(AppPolicyCfg policy:ipLists){
if(policy.getBehavCode()==null) continue;
for(SpecificServiceCfg secondCfg:secondList) {
if(secondCfg.getSpecServiceCode()==null) continue;
@@ -1678,13 +1678,13 @@ public class AppCfgController extends BaseController {
noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport);
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
for (AppPolicyCfg cfg : page.getList()) {
for (AppPolicyCfg cfg : ipLists) {
AppPolicyCfg cfgIndexInfo=appCfgService.exportIpInfo(cfg);
ipList.addAll(cfgIndexInfo.getIpPortList());
subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
}
subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
dataMap.put("NTC_IP", ipList);
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
@@ -1707,21 +1707,21 @@ public class AppCfgController extends BaseController {
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<AppTopicDomainCfg> ipLists=new ArrayList<AppTopicDomainCfg>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=appCfgService.findAppByTopicDomainList(ids);
}else{
Page<AppTopicDomainCfg> pageInfo=new Page<AppTopicDomainCfg>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<AppTopicDomainCfg> page = appCfgService.findAppTopicDomainList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<AppTopicDomainCfg> pageInfo=new Page<AppTopicDomainCfg>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<AppTopicDomainCfg> page = appCfgService.findAppTopicDomainList(pageInfo, entity);
for (int i = 0; i < page.getList().size(); i++) {
AppTopicDomainCfg appTop=page.getList().get(i);
for (int i = 0; i < ipLists.size(); i++) {
AppTopicDomainCfg appTop=ipLists.get(i);
appTop.setIsHex(appTop.getIsHexbin());
appTop.setIsCaseInsenstive(appTop.getIsHexbin());
}
@@ -1729,7 +1729,7 @@ public class AppCfgController extends BaseController {
classMap.put(entity.getMenuNameCode(), AppTopicDomainCfg.class);
String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
/*}*/
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
} catch (Exception e) {
@@ -1750,21 +1750,20 @@ public class AppCfgController extends BaseController {
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<AppIpCfg> ipLists=new ArrayList<AppIpCfg>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=appCfgService.findAppByIpList(ids);
}else{
Page<AppIpCfg> pageInfo=new Page<AppIpCfg>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<AppIpCfg> page = appCfgService.findAppIpList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<AppIpCfg> pageInfo=new Page<AppIpCfg>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<AppIpCfg> page = appCfgService.findAppIpList(pageInfo, entity);
for(AppIpCfg appIp:page.getList()){
for(AppIpCfg appIp:ipLists){
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(appIp.getSpecServiceId());
appIp.setAppName(app.getSpecServiceName());
}
@@ -1772,7 +1771,7 @@ public class AppCfgController extends BaseController {
classMap.put(entity.getMenuNameCode(), AppIpCfg.class);
String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(),ipLists);
/*}*/
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
} catch (Exception e) {
@@ -1792,22 +1791,19 @@ public class AppCfgController extends BaseController {
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<AppHttpCfg> ipLists=new ArrayList<AppHttpCfg>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=appCfgService.findAppByHttpList(ids);
}else{
Page<AppHttpCfg> pageInfo=new Page<AppHttpCfg>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<AppHttpCfg> page = appCfgService.findAppHttpList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<AppHttpCfg> pageInfo=new Page<AppHttpCfg>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<AppHttpCfg> page = appCfgService.findAppHttpList(pageInfo, entity);
for(AppHttpCfg http:page.getList()){
for(AppHttpCfg http:ipLists){
http.setIsHex(http.getIsHexbin());
http.setIsCaseInsenstive(http.getIsHexbin());
http.setCfgKeywords(Functions.replace(http.getCfgKeywords(), "***and***"," "));
@@ -1819,7 +1815,7 @@ public class AppCfgController extends BaseController {
classMap.put(entity.getMenuNameCode(), AppHttpCfg.class);
String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
/*}*/
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
} catch (Exception e) {
@@ -1840,21 +1836,17 @@ public class AppCfgController extends BaseController {
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<AppDomainCfg> ipLists= new ArrayList<AppDomainCfg>();
if(!StringUtil.isEmpty(ids)){
ipLists=appCfgService.findAppByDomainList(ids);
}else{
Page<AppDomainCfg> pageInfo=new Page<AppDomainCfg>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<AppDomainCfg> page = appCfgService.findAppDomainList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<AppDomainCfg> pageInfo=new Page<AppDomainCfg>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<AppDomainCfg> page = appCfgService.findAppDomainList(pageInfo, entity);
for(AppDomainCfg domain:page.getList()){
for(AppDomainCfg domain:ipLists){
domain.setIsHex(domain.getIsHexbin());
domain.setIsCaseInsenstive(domain.getIsHexbin());
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(domain.getSpecServiceId());
@@ -1865,7 +1857,7 @@ public class AppCfgController extends BaseController {
classMap.put(entity.getMenuNameCode(), AppDomainCfg.class);
String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
/*}*/
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
} catch (Exception e) {
@@ -1886,21 +1878,18 @@ public class AppCfgController extends BaseController {
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
List<AppSslCertCfg> ipLists= new ArrayList<AppSslCertCfg>();
if(!StringUtil.isEmpty(ids)){
ipLists=appCfgService.findAppBySslList(ids);
}else{
Page<AppSslCertCfg> pageInfo=new Page<AppSslCertCfg>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<AppSslCertCfg> page = appCfgService.findAppSslList(pageInfo, entity);
for(AppSslCertCfg ssl:page.getList()){
ipLists=page.getList();
}
for(AppSslCertCfg ssl:ipLists){
ssl.setIsHex(ssl.getIsHexbin());
ssl.setIsCaseInsenstive(ssl.getIsHexbin());
ssl.setCfgKeywords(Functions.replace(ssl.getCfgKeywords(), "***and***"," "));
@@ -1911,7 +1900,7 @@ public class AppCfgController extends BaseController {
classMap.put(entity.getMenuNameCode(), AppSslCertCfg.class);
String cfgIndexInfoNoExport=",letter,whether_area_block,classification,attribute,label,do_log,block_type,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(),ipLists);
/*}*/
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
} catch (Exception e) {

View File

@@ -46,6 +46,7 @@ import com.nis.domain.configuration.BaseStringCfg;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.domain.configuration.PxyObjTrustedCaCert;
import com.nis.domain.configuration.WebsiteDomainTopic;
import com.nis.domain.maat.ToMaatResult;
import com.nis.domain.maat.ToMaatResult.ResponseData;
@@ -300,22 +301,19 @@ public class AppFeatureCfgController extends BaseController {
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
List<AppFeatureIndex> ipLists=new ArrayList<AppFeatureIndex>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=appMultiFeatureCfgService.findAppByFeatureIndexList(ids);
}else{
Page<AppFeatureIndex> pageInfo=new Page<AppFeatureIndex>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<AppFeatureIndex> page = appMultiFeatureCfgService.findAppFeatureIndexList(pageInfo, entity);
for(AppFeatureIndex feature:page.getList()){
ipLists=page.getList();
}
for(AppFeatureIndex feature:ipLists){
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(feature.getSpecServiceId());
feature.setAppName(app.getSpecServiceName());
}
@@ -334,7 +332,7 @@ public class AppFeatureCfgController extends BaseController {
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
List<AppComplexFeatureCfg> keywordList=new ArrayList<AppComplexFeatureCfg>();
List<AppStringFeatureCfg> strList=new ArrayList<AppStringFeatureCfg>();
for (AppFeatureIndex cfg : page.getList()) {
for (AppFeatureIndex cfg : ipLists) {
Map<String, List> maps=appMultiFeatureCfgService.exportFeature(cfg);
if(entity.getFunctionId()!=567){
keywordList.addAll(maps.get("APP_KEYWORDS"));
@@ -343,7 +341,7 @@ public class AppFeatureCfgController extends BaseController {
}
ipList.addAll(maps.get("APP_IP_RANGE"));
}
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
if(entity.getFunctionId()!=564 && entity.getFunctionId()!=567 ){
keywordList=replaceKeyList(keywordList);
titleList.add("APP_IP_RANGE");

View File

@@ -258,20 +258,20 @@ public class BasicProtocolController extends BaseController {
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<AppPolicyCfg> ipLists=new ArrayList<AppPolicyCfg>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=appCfgService.findAppByPolicyList(ids);
}else{
entity.setTableName(IpPortCfg.getTablename());
Page<AppPolicyCfg> pageInfo=new Page<AppPolicyCfg>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<AppPolicyCfg> pageInfo=new Page<AppPolicyCfg>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
for(AppPolicyCfg policy:page.getList()){
for(AppPolicyCfg policy:ipLists){
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId());
if(app!=null) {
policy.setAppName(app.getSpecServiceName());
@@ -298,13 +298,13 @@ public class BasicProtocolController extends BaseController {
noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport);
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
for (AppPolicyCfg cfg : page.getList()) {
for (AppPolicyCfg cfg : ipLists) {
AppPolicyCfg cfgIndexInfo=appCfgService.exportIpInfo(cfg);
ipList.addAll(cfgIndexInfo.getIpPortList());
subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
}
subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
dataMap.put("NTC_IP", ipList);
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);

View File

@@ -278,20 +278,19 @@ public class EncryptedTunnelBehaviorController extends BaseController {
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<AppPolicyCfg> ipLists=new ArrayList<AppPolicyCfg>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=appCfgService.findAppByPolicyList(ids);
}else{
entity.setTableName(IpPortCfg.getTablename());
Page<AppPolicyCfg> pageInfo=new Page<AppPolicyCfg>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<AppPolicyCfg> pageInfo=new Page<AppPolicyCfg>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
for(AppPolicyCfg policy:page.getList()){
for(AppPolicyCfg policy:ipLists){
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId());
if(app!=null) {
policy.setBehaviorName(app.getSpecServiceName());
@@ -309,7 +308,7 @@ public class EncryptedTunnelBehaviorController extends BaseController {
second.setIsLeaf(1);
List<SpecificServiceCfg> secondList=specificServiceCfgService.findAllSpecificServiceCfg(second, null);
//遍历,找到匹配项后将行为设置进去
for(AppPolicyCfg policy:page.getList()){
for(AppPolicyCfg policy:ipLists){
if(policy.getBehavCode()==null) continue;
for(SpecificServiceCfg secondCfg:secondList) {
if(secondCfg.getSpecServiceCode()==null) continue;
@@ -339,13 +338,13 @@ public class EncryptedTunnelBehaviorController extends BaseController {
noExportMap.put("NTC_SUBSCRIBE_ID", subscribeInfoNoExport);
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
for (AppPolicyCfg cfg : page.getList()) {
for (AppPolicyCfg cfg : ipLists) {
AppPolicyCfg cfgIndexInfo=appCfgService.exportIpInfo(cfg);
ipList.addAll(cfgIndexInfo.getIpPortList());
subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
}
subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
dataMap.put("NTC_IP", ipList);
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);

View File

@@ -24,6 +24,7 @@ import com.nis.domain.Page;
import com.nis.domain.basics.PolicyGroupInfo;
import com.nis.domain.basics.ServiceDictInfo;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.DnsIpCfg;
import com.nis.domain.configuration.DnsResStrategy;
import com.nis.domain.configuration.IpPortCfg;
@@ -212,32 +213,30 @@ public class DnsIpCfgController extends BaseController {
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<DnsIpCfg> ipLists=new ArrayList<DnsIpCfg>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=dnsIpCfgService.findByPage(ids);
}else{
Page<DnsIpCfg> pageInfo=new Page<DnsIpCfg>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<DnsIpCfg> page = dnsIpCfgService.findPage(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<DnsIpCfg> pageInfo=new Page<DnsIpCfg>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<DnsIpCfg> page = dnsIpCfgService.findPage(pageInfo, entity);
for (int i = 0; i < page.getList().size(); i++) {
if(StringUtil.isEmpty(page.getList().get(i).getDnsStrategyName())){
for (int i = 0; i < ipLists.size(); i++) {
if(StringUtil.isEmpty(ipLists.get(i).getDnsStrategyName())){
Properties msgProp = getMsgProp();
page.getList().get(i).setDnsStrategyName(msgProp.getProperty("default_group"));
ipLists.get(i).setDnsStrategyName(msgProp.getProperty("default_group"));
}
}
model.addAttribute("page", page);
titleList.add(entity.getMenuNameCode());
classMap.put(entity.getMenuNameCode(), DnsIpCfg.class);
String cfgIndexInfoNoExport=",whether_area_block,client_ip,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
/*}*/
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
} catch (Exception e) {

View File

@@ -22,6 +22,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.nis.domain.Page;
import com.nis.domain.basics.PolicyGroupInfo;
import com.nis.domain.configuration.AppSslCertCfg;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.DnsResStrategy;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.specific.SpecificServiceCfg;
@@ -184,29 +185,27 @@ public class DnsResStrategyController extends BaseController {
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<DnsResStrategy> ipLists=new ArrayList<DnsResStrategy>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=dnsResStrategyService.findByPage(ids);
}else{
Page<DnsResStrategy> pageInfo=new Page<DnsResStrategy>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<DnsResStrategy> page = dnsResStrategyService.findPage(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<DnsResStrategy> pageInfo=new Page<DnsResStrategy>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<DnsResStrategy> page = dnsResStrategyService.findPage(pageInfo, entity);
for (int i = 0; i < page.getList().size(); i++) {
page.getList().get(i).setMiTtlmax(String.valueOf(page.getList().get(i).getMinTtl())+"-"+String.valueOf(page.getList().get(i).getMaxTtl()));
for (int i = 0; i < ipLists.size(); i++) {
ipLists.get(i).setMiTtlmax(String.valueOf(ipLists.get(i).getMinTtl())+"-"+String.valueOf(ipLists.get(i).getMaxTtl()));
ipLists.get(i).setDnsId( String.valueOf(ipLists.get(i).getCfgId()));
}
titleList.add(entity.getMenuNameCode());
classMap.put(entity.getMenuNameCode(), DnsResStrategy.class);
String cfgIndexInfoNoExport=",valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
String cfgIndexInfoNoExport=",cfg_id,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(),ipLists);
/*}*/
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
} catch (Exception e) {

View File

@@ -148,7 +148,18 @@ public class DdosCfgController extends BaseController {
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
List<DdosIpCfg> ipLists=new ArrayList<DdosIpCfg>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=ddosCfgService.findByPage(ids);
}else{
entity.setTableName(IpPortCfg.getTablename());
Page<DdosIpCfg> pageInfo=new Page<DdosIpCfg>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<DdosIpCfg> page = ddosCfgService.findPage(pageInfo, entity);
ipLists=page.getList();
}
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
@@ -157,16 +168,12 @@ public class DdosCfgController extends BaseController {
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<DdosIpCfg> pageInfo=new Page<DdosIpCfg>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<DdosIpCfg> page = ddosCfgService.findPage(pageInfo, entity);
titleList.add(entity.getMenuNameCode());
classMap.put(entity.getMenuNameCode(), DdosIpCfg.class);
String cfgIndexInfoNoExport=",do_log,client_ip,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
/*}*/
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
} catch (Exception e) {

View File

@@ -968,29 +968,27 @@ public class AvContentController extends BaseController {
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=ipCfgService.getByIdsList(ids);
}else{
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
if(entity.getIpPort()== null){
entity.setIpPort(new IpPortCfg());
}
if(entity.getAvContUrlCfgList()== null){
entity.setAvContUrlCfg(new AvContUrlCfg());;
}
if(entity.getNtcSubscribeIdCfg()==null){
entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg());
}
Page<CfgIndexInfo> page = avContentCfgService.findPage(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
if(entity.getIpPort()== null){
entity.setIpPort(new IpPortCfg());
}
if(entity.getAvContUrlCfgList()== null){
entity.setAvContUrlCfg(new AvContUrlCfg());;
}
if(entity.getNtcSubscribeIdCfg()==null){
entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg());
}
Page<CfgIndexInfo> page = avContentCfgService.findPage(pageInfo, entity);
titleList.add(entity.getMenuNameCode());
titleList.add("NTC_UNIVERSAL_IP");
titleList.add("NTC_STREAMING_MEDIA_URL");
@@ -1021,7 +1019,7 @@ public class AvContentController extends BaseController {
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
List<BaseStringCfg> streamurlList=new ArrayList<BaseStringCfg>();
for (CfgIndexInfo cfg : page.getList()) {
for (CfgIndexInfo cfg : ipLists) {
Map<String, List> maps=avContentCfgService.exportstream(cfg);
ipList.addAll(maps.get("NTC_UNIVERSAL_IP"));
streamurlList.addAll(maps.get("NTC_STREAMING_MEDIA_URL"));
@@ -1029,7 +1027,7 @@ public class AvContentController extends BaseController {
}
subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
streamurlList=BaseStringCfg.replaceBaseKeyList(streamurlList);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
dataMap.put("NTC_UNIVERSAL_IP", ipList);
dataMap.put("NTC_STREAMING_MEDIA_URL", streamurlList);
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
@@ -1054,28 +1052,28 @@ public class AvContentController extends BaseController {
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=ipCfgService.getByIdsList(ids);
}else{
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
if(entity.getIpPort()== null){
entity.setIpPort(new IpPortCfg());
}
if(entity.getVoipAccount()== null){
entity.setVoipAccount(new AvVoipAccountCfg());
}
if(entity.getNtcSubscribeIdCfg()==null){
entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg());
}
Page<CfgIndexInfo> page = avContentCfgService.findPage(new Page<CfgIndexInfo>(request, response,"r"), entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
if(entity.getIpPort()== null){
entity.setIpPort(new IpPortCfg());
}
if(entity.getVoipAccount()== null){
entity.setVoipAccount(new AvVoipAccountCfg());
}
if(entity.getNtcSubscribeIdCfg()==null){
entity.setNtcSubscribeIdCfg(new NtcSubscribeIdCfg());
}
Page<CfgIndexInfo> page = avContentCfgService.findPage(new Page<CfgIndexInfo>(request, response,"r"), entity);
titleList.add(entity.getMenuNameCode());
titleList.add("NTC_UNIVERSAL_IP");
titleList.add("NTC_VOIP_ACCOUNT");
@@ -1106,7 +1104,7 @@ public class AvContentController extends BaseController {
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
List<BaseStringCfg> countlList=new ArrayList<BaseStringCfg>();
for (CfgIndexInfo cfg : page.getList()) {
for (CfgIndexInfo cfg : ipLists) {
Map<String, List> maps=avContentCfgService.exportvoip(cfg);
ipList.addAll(maps.get("NTC_UNIVERSAL_IP"));
countlList.addAll(maps.get("NTC_VOIP_ACCOUNT"));
@@ -1114,7 +1112,7 @@ public class AvContentController extends BaseController {
}
countlList=BaseStringCfg.replaceBaseKeyList(countlList);
subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(),ipLists);
dataMap.put("NTC_UNIVERSAL_IP", ipList);
dataMap.put("NTC_VOIP_ACCOUNT", countlList);
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);

View File

@@ -195,19 +195,18 @@ public class BgpCfgController extends BaseController{
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=ipCfgService.getByIdsList(ids);
}else{
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = bgpCfgService.getBgpList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = bgpCfgService.getBgpList(pageInfo, entity);
titleList.add(entity.getMenuNameCode());
titleList.add("NTC_IP");
titleList.add("NTC_BGP_AS");
@@ -236,7 +235,7 @@ public class BgpCfgController extends BaseController{
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
// List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
List<BaseStringCfg> asInfoList=new ArrayList<BaseStringCfg>();
for (CfgIndexInfo cfg : page.getList()) {
for (CfgIndexInfo cfg : ipLists) {
CfgIndexInfo cfgIndexInfo=bgpCfgService.exportbgp(cfg);
ipList.addAll(cfgIndexInfo.getIpPortList());
// subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
@@ -244,7 +243,7 @@ public class BgpCfgController extends BaseController{
}
asInfoList=BaseStringCfg.replaceBaseKeyList(asInfoList);
// subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
dataMap.put("NTC_IP", ipList);
dataMap.put("NTC_BGP_AS", asInfoList);
// dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);

View File

@@ -617,20 +617,19 @@ public class FileTransferCfgController extends BaseController{
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=ipCfgService.getByIdsList(ids);
}else{
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = fileTransferCfgService.getFtpList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = fileTransferCfgService.getFtpList(pageInfo, entity);
titleList.add(entity.getMenuNameCode());
titleList.add("NTC_UNIVERSAL_IP");
titleList.add("NTC_FTP_URL");
@@ -665,7 +664,7 @@ public class FileTransferCfgController extends BaseController{
List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
List<BaseStringCfg> ftpkeyList=new ArrayList<BaseStringCfg>();
List<BaseStringCfg> ftpurlList=new ArrayList<BaseStringCfg>();
for (CfgIndexInfo cfg : page.getList()) {
for (CfgIndexInfo cfg : ipLists) {
Map<String, List> maps=fileTransferCfgService.exportftp(cfg);
ftpkeyList.addAll(maps.get("NTC_FTP_CONTENT"));
ftpurlList.addAll(maps.get("NTC_FTP_URL"));
@@ -675,7 +674,7 @@ public class FileTransferCfgController extends BaseController{
subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
ftpkeyList=BaseStringCfg.replaceBaseKeyList(ftpkeyList);
ftpurlList=BaseStringCfg.replaceBaseKeyList(ftpurlList);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
dataMap.put("NTC_UNIVERSAL_IP", ipList);
dataMap.put("NTC_FTP_URL", ftpurlList);
dataMap.put("NTC_FTP_CONTENT", ftpkeyList);
@@ -701,19 +700,19 @@ public class FileTransferCfgController extends BaseController{
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=ipCfgService.getByIdsList(ids);
}else{
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = fileTransferCfgService.getP2pList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = fileTransferCfgService.getP2pList(pageInfo, entity);
titleList.add(entity.getMenuNameCode());
titleList.add("NTC_UNIVERSAL_IP");
@@ -753,7 +752,7 @@ public class FileTransferCfgController extends BaseController{
List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
List<BaseStringCfg> hashList=new ArrayList<BaseStringCfg>();
List<BaseStringCfg> keywordList=new ArrayList<BaseStringCfg>();
for (CfgIndexInfo cfg : page.getList()) {
for (CfgIndexInfo cfg : ipLists) {
Map<String, List> maps=fileTransferCfgService.exportp2p(cfg);
keywordList.addAll(maps.get("NTC_P2P_KEYWORDS"));
hashList.addAll(maps.get("NTC_P2P_HASH_BIN"));
@@ -763,7 +762,7 @@ public class FileTransferCfgController extends BaseController{
subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
keywordList=BaseStringCfg.replaceBaseKeyList(keywordList);
hashList=BaseStringCfg.replaceBaseKeyList(hashList);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
dataMap.put("NTC_UNIVERSAL_IP", ipList);
dataMap.put("NTC_P2P_KEYWORDS", keywordList);
dataMap.put("NTC_P2P_HASH_BIN", hashList);

View File

@@ -435,19 +435,18 @@ public class IpController extends BaseController{
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=ipCfgService.getByIdsList(ids);
}else{
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
titleList.add(entity.getMenuNameCode());
titleList.add("NTC_IP");
titleList.add("asn_policy");
@@ -465,7 +464,7 @@ public class IpController extends BaseController{
noExportMap.put("asn_policy", asnGroupInfoNoExport);
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
List<ConfigGroupInfo> groupInfoList=new ArrayList<ConfigGroupInfo>();
for (CfgIndexInfo cfg : page.getList()) {
for (CfgIndexInfo cfg : ipLists) {
CfgIndexInfo cfgIndexInfo=ipCfgService.exportIpInfo(cfg);
ipList.addAll(cfgIndexInfo.getIpPortList());
if(!StringUtil.isEmpty(cfgIndexInfo.getAsnIpGroupName())){
@@ -475,7 +474,7 @@ public class IpController extends BaseController{
groupInfoList.add(group);
}
}
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
dataMap.put("NTC_IP", ipList);
dataMap.put("asn_policy", groupInfoList);

View File

@@ -234,20 +234,19 @@ public class MailCfgController extends BaseController{
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=ipCfgService.getByIdsList(ids);
}else{
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = mailCfgService.getMailList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = mailCfgService.getMailList(pageInfo, entity);
titleList.add(entity.getMenuNameCode());
String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
String ipPortInfoNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
@@ -287,7 +286,7 @@ public class MailCfgController extends BaseController{
List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
List<ComplexkeywordCfg> mailBodyList=new ArrayList<ComplexkeywordCfg>();
List<ComplexkeywordCfg> mailReqHdrList=new ArrayList<ComplexkeywordCfg>();
for (CfgIndexInfo cfg : page.getList()) {
for (CfgIndexInfo cfg : ipLists) {
Map<String, List> maps=mailCfgService.exportmail(cfg);
mailReqHdrList.addAll(maps.get("NTC_MAIL_HDR"));
mailBodyList.addAll(maps.get("NTC_MAIL_BODY"));
@@ -304,7 +303,7 @@ public class MailCfgController extends BaseController{
}
}
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
dataMap.put("NTC_MAIL_HDR", mailReqHdrList);
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
/*}*/

View File

@@ -638,18 +638,19 @@ public class WebsiteController extends BaseController{
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
/*//导出选中记录
if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=ipCfgService.getByIdsList(ids);
}else{
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity);
String cfgIndexInfoNoExport=",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
String httpUrlCfgNoExport=",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
+ ",config_time,editor,edit_time,auditor,audit_time"
@@ -686,7 +687,7 @@ public class WebsiteController extends BaseController{
List<BaseStringCfg> httpResBodyList = new ArrayList<>();
List<IpPortCfg> ipPortList = new ArrayList<>();
List<BaseStringCfg> subscribeIdList = new ArrayList<>();
for (CfgIndexInfo cfg : page.getList()) {
for (CfgIndexInfo cfg : ipLists) {
Map<String, List> maps=websiteCfgService.exportHttpCfg(cfg);
httpUrlList.addAll(maps.get("NTC_HTTP_URL"));
httpReqHdrList.addAll(maps.get("NTC_HTTP_REQ_HDR"));
@@ -705,7 +706,7 @@ public class WebsiteController extends BaseController{
titleList.add(entity.getMenuNameCode());
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(),ipLists);
if(entity.getFunctionId()!=635){
titleList.add("NTC_HTTP_URL");
@@ -759,36 +760,35 @@ public class WebsiteController extends BaseController{
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=ipCfgService.getByIdsList(ids);
}else{
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(pageInfo, entity);
for (int i = 0; i < page.getList().size(); i++) {
for (int i = 0; i < ipLists.size(); i++) {
Properties msgProp = getMsgProp();
if(page.getList().get(i).getDnsStrategyId()!=null && page.getList().get(i).getDnsStrategyId()!=0){
List<DnsResStrategy> resStrategys=dnsResStrategyService.findDnsResStrategys(page.getList().get(i).getDnsStrategyId(), 1,1);
if(ipLists.get(i).getDnsStrategyId()!=null && ipLists.get(i).getDnsStrategyId()!=0){
List<DnsResStrategy> resStrategys=dnsResStrategyService.findDnsResStrategys(ipLists.get(i).getDnsStrategyId(), 1,1);
if(resStrategys!=null && resStrategys.size()>0){
String msg= msgProp.getProperty(resStrategys.get(0).getCfgDesc());
if(!StringUtil.isEmpty(msg)){
page.getList().get(i).setDnsStrategyName(msg);
ipLists.get(i).setDnsStrategyName(msg);
}else{
page.getList().get(i).setDnsStrategyName(resStrategys.get(0).getCfgDesc());
ipLists.get(i).setDnsStrategyName(resStrategys.get(0).getCfgDesc());
}
}else{
page.getList().get(i).setDnsStrategyName(msgProp.getProperty("no_strategy"));
ipLists.get(i).setDnsStrategyName(msgProp.getProperty("no_strategy"));
}
}else{
page.getList().get(i).setDnsStrategyName(msgProp.getProperty("no_strategy"));
ipLists.get(i).setDnsStrategyName(msgProp.getProperty("no_strategy"));
}
}
titleList.add(entity.getMenuNameCode());
@@ -819,7 +819,7 @@ public class WebsiteController extends BaseController{
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
List<BaseStringCfg> subscribeInfoList=new ArrayList<BaseStringCfg>();
List<ComplexkeywordCfg> regionInfoList=new ArrayList<ComplexkeywordCfg>();
for (CfgIndexInfo cfg : page.getList()) {
for (CfgIndexInfo cfg : ipLists) {
CfgIndexInfo cfgIndexInfo=websiteCfgService.exportdns(cfg);
ipList.addAll(cfgIndexInfo.getIpPortList());
subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
@@ -827,7 +827,7 @@ public class WebsiteController extends BaseController{
}
subscribeInfoList=BaseStringCfg.baseHexList(subscribeInfoList);
regionInfoList=ComplexkeywordCfg.replaceComplexKeyList(regionInfoList);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(),ipLists);
dataMap.put("NTC_IP", ipList);
dataMap.put("NTC_DNS_REGION", regionInfoList);
dataMap.put("NTC_SUBSCRIBE_ID", subscribeInfoList);
@@ -854,18 +854,18 @@ public class WebsiteController extends BaseController{
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
/*//导出选中记录
if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=ipCfgService.getByIdsList(ids);
}else{
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(pageInfo, entity);
titleList.add(entity.getMenuNameCode());
titleList.add("NTC_UNIVERSAL_IP");
titleList.add("NTC_SSL_SNI");
@@ -903,7 +903,7 @@ public class WebsiteController extends BaseController{
List<BaseStringCfg> sslCnList = new ArrayList<>();
List<IpPortCfg> ipPortList = new ArrayList<>();
List<BaseStringCfg> subscribeIdList = new ArrayList<BaseStringCfg>();
for (CfgIndexInfo cfg : page.getList()) {
for (CfgIndexInfo cfg : ipLists) {
Map<String, List> maps=websiteCfgService.exportssl(cfg);
sslSniList.addAll(maps.get("NTC_SSL_SNI"));
sslSnaList.addAll(maps.get("NTC_SSL_SAN"));
@@ -915,7 +915,7 @@ public class WebsiteController extends BaseController{
sslSnaList=BaseStringCfg.replaceBaseKeyList(sslSnaList);
sslCnList=BaseStringCfg.replaceBaseKeyList(sslCnList);
subscribeIdList=BaseStringCfg.baseHexList(subscribeIdList);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
dataMap.put("NTC_UNIVERSAL_IP", ipPortList);
dataMap.put("NTC_SSL_SNI", sslSniList);
dataMap.put("NTC_SSL_SAN", sslSnaList);

View File

@@ -343,20 +343,18 @@ public class WhiteListController extends CommonController{
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=ipCfgService.getByIdsList(ids);
}else{
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
titleList.add(entity.getMenuNameCode());
titleList.add("NTC_IP");
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
@@ -369,11 +367,11 @@ public class WhiteListController extends CommonController{
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
noExportMap.put("NTC_IP", ipPortInfoNoExport);
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
for (CfgIndexInfo cfg : page.getList()) {
for (CfgIndexInfo cfg :ipLists) {
CfgIndexInfo cfgIndexInfo=ipCfgService.exportIpInfo(cfg);
ipList.addAll(cfgIndexInfo.getIpPortList());
}
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
dataMap.put("NTC_IP", ipList);
/*}*/
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
@@ -394,20 +392,19 @@ public class WhiteListController extends CommonController{
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=ipCfgService.getByIdsList(ids);
}else{
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = domainService.getDomainList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = domainService.getDomainList(pageInfo, entity);
titleList.add(entity.getMenuNameCode());
titleList.add("NTC_HTTP_URL");
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
@@ -420,12 +417,12 @@ public class WhiteListController extends CommonController{
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
noExportMap.put("NTC_HTTP_URL", httpUrlInfoNoExport);
List<BaseStringCfg> httpurlList=new ArrayList<BaseStringCfg>();
for (CfgIndexInfo cfg : page.getList()) {
for (CfgIndexInfo cfg : ipLists) {
CfgIndexInfo cfgIndexInfo=domainService.exportDomainInfo(cfg);
httpurlList.addAll(cfgIndexInfo.getHttpUrlList());
}
httpurlList=BaseStringCfg.replaceBaseKeyList(httpurlList);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
dataMap.put("NTC_HTTP_URL", httpurlList);
/*}*/
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);

View File

@@ -292,21 +292,20 @@ public class HttpRedirectPolicyController extends BaseController{
List<FunctionRegionDict> regionList = DictUtils.getFunctionRegionDictList(entity.getFunctionId());
/*//导出选中记录
if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=ipCfgService.getByIdsList(ids);
}else{
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity);
Properties prop = getMsgProp();
for (CfgIndexInfo str : page.getList()) {
for (CfgIndexInfo str :ipLists) {
if(entity.getFunctionId()!=210 && entity.getFunctionId()!=211){
String type="RESPONSE_CODE";
if(entity.getFunctionId()==207){
@@ -377,7 +376,7 @@ public class HttpRedirectPolicyController extends BaseController{
List<BaseStringCfg> httpResBodyList = new ArrayList<>();
List<IpPortCfg> ipPortList = new ArrayList<>();
List<BaseStringCfg> subscribeIdList = new ArrayList<>();
for (CfgIndexInfo cfg : page.getList()) {
for (CfgIndexInfo cfg : ipLists) {
Map<String, List> maps=httpRedirectCfgService.exportHttpCfg(cfg);
httpUrlList.addAll(maps.get("NTC_HTTP_URL"));
httpReqHdrList.addAll(maps.get("NTC_HTTP_REQ_HDR"));
@@ -402,7 +401,7 @@ public class HttpRedirectPolicyController extends BaseController{
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
noExportMap.put("NTC_HTTP_URL", httpUrlCfgNoExport);
noExportMap.put("NTC_HTTP_REQ_HDR", httpReqHeadCfgNoExport);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
dataMap.put("NTC_HTTP_URL", httpUrlList);
dataMap.put("NTC_HTTP_REQ_HDR", httpReqHdrList);
if(entity.getFunctionId()!=208 && entity.getFunctionId()!=211){

View File

@@ -241,21 +241,18 @@ public class InterceptController extends CommonController{
Map<String, String> noExportMap=new HashMap<String, String>();
Map<String, String> replaceExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<CfgIndexInfo> ipLists=new ArrayList<CfgIndexInfo>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=ipCfgService.getByIdsList(ids);
}else{
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<CfgIndexInfo> pageInfo=new Page<CfgIndexInfo>(request, response,"a");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
//获取证书信息
List<PxyObjKeyring> certificateList=new ArrayList<PxyObjKeyring>();
if(entity.getFunctionId().equals(200)){
@@ -264,7 +261,7 @@ public class InterceptController extends CommonController{
if(entity.getFunctionId().equals(201)){
certificateList=pxyObjKeyringService.findPxyObjKeyrings(null, 1, 1, "domain");
}
for (CfgIndexInfo str : page.getList()) {
for (CfgIndexInfo str : ipLists) {
if(!StringUtil.isEmpty(str.getUserRegion5())){
Properties prop = getMsgProp();
String cs= DictUtils.getDictLabel("INTERCEPT_DOMAIN_INTENSITY", str.getUserRegion5());
@@ -308,7 +305,7 @@ public class InterceptController extends CommonController{
List<IpPortCfg> ipList=new ArrayList<IpPortCfg>();
List<BaseStringCfg> httpUrlList=new ArrayList<BaseStringCfg>();
List<BaseStringCfg> pktBinList=new ArrayList<BaseStringCfg>();
for (CfgIndexInfo cfg : page.getList()) {
for (CfgIndexInfo cfg : ipLists) {
Map<String, List> maps=interceptCfgService.exportIpInfo(cfg);
httpUrlList.addAll(maps.get("NTC_HTTP_URL"));
ipList.addAll(maps.get("PXY_INTERCEPT_IP"));
@@ -316,7 +313,7 @@ public class InterceptController extends CommonController{
}
pktBinList=BaseStringCfg.replaceBaseKeyList(pktBinList);
httpUrlList=BaseStringCfg.baseHexList(httpUrlList);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
if(entity.getFunctionId()==212){ //IP Payload
cfgIndexInfoNoExport=",do_log,log_total,policy_name,group_name,userregion4,userregion5,&userregion1:replace_zone-userregion2:replaced_content-userregion3:replace_content-";
titleList.add("PXY_INTERCEPT_IP");

View File

@@ -39,6 +39,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.google.common.collect.Maps;
import com.nis.domain.Page;
import com.nis.domain.basics.PolicyGroupInfo;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.DnsResStrategy;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.PxyObjKeyring;
@@ -410,29 +411,27 @@ public class PxyObjKeyringController extends BaseController {
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<PxyObjKeyring> ipLists=new ArrayList<PxyObjKeyring>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=pxyObjKeyringService.findByList(ids);
}else{
entity.setTableName(IpPortCfg.getTablename());
Page<PxyObjKeyring> pageInfo=new Page<PxyObjKeyring>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<PxyObjKeyring> page = pxyObjKeyringService.findPage(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<PxyObjKeyring> pageInfo=new Page<PxyObjKeyring>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<PxyObjKeyring> page = pxyObjKeyringService.findPage(pageInfo, entity);
for (int i = 0; i <page.getList().size(); i++) {
page.getList().get(i).setKeyringName(page.getList().get(i).getCfgDesc());
for (int i = 0; i <ipLists.size(); i++) {
ipLists.get(i).setKeyringName(ipLists.get(i).getCfgDesc());
}
model.addAttribute("page", page);
titleList.add(entity.getMenuNameCode());
classMap.put(entity.getMenuNameCode(), PxyObjKeyring.class);
String cfgIndexInfoNoExport=",config_describe,whether_area_block,block_type,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
/*}*/
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
} catch (Exception e) {
@@ -452,32 +451,27 @@ public class PxyObjKeyringController extends BaseController {
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
/*//导出选中记录
* if(!StringUtil.isEmpty(ids)){
for(String id:ids.split(",")){
Long.parseLong(id);
List<PxyObjTrustedCaCert> ipLists=new ArrayList<PxyObjTrustedCaCert>();
//导出选中记录
if(!StringUtil.isEmpty(ids)){
ipLists=pxyObjKeyringService.findByCertList(ids);
}else{
Page<PxyObjTrustedCaCert> pageInfo=new Page<PxyObjTrustedCaCert>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<PxyObjTrustedCaCert> page = pxyObjKeyringService.findTrustedCertPage(pageInfo, entity);
ipLists=page.getList();
}
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
}else{*/
//条件导出数据大于最大导出数,只导出最大导出条数
entity.setTableName(IpPortCfg.getTablename());
Page<PxyObjTrustedCaCert> pageInfo=new Page<PxyObjTrustedCaCert>(request, response,"r");
pageInfo.setPageNo(1);
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
Page<PxyObjTrustedCaCert> page = pxyObjKeyringService.findTrustedCertPage(pageInfo, entity);
for (PxyObjTrustedCaCert cert:page.getList()) {
for (PxyObjTrustedCaCert cert:ipLists) {
if(!StringUtil.isEmpty(cert.getCompileId())){
cert.setCrlFile(ConfigDictUtils.getTrustedCrlByCerId(cert.getCompileId()));
}
}
model.addAttribute("page", page);
titleList.add(entity.getMenuNameCode());
classMap.put(entity.getMenuNameCode(), PxyObjTrustedCaCert.class);
String cfgIndexInfoNoExport=",whether_area_block,block_type,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,&config_describe:cert_name-";
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
dataMap.put(entity.getMenuNameCode(), page.getList());
dataMap.put(entity.getMenuNameCode(), ipLists);
/*}*/
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
} catch (Exception e) {

View File

@@ -1,12 +1,15 @@
package com.nis.web.controller.dashboard;
import java.lang.reflect.Type;
import java.math.BigDecimal;
import java.net.URISyntaxException;
import java.net.URLEncoder;
import java.text.DecimalFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -35,10 +38,13 @@ import com.google.gson.JsonParseException;
import com.google.gson.LongSerializationPolicy;
import com.google.gson.reflect.TypeToken;
import com.nis.domain.PageLog;
import com.nis.domain.SysDataDictionaryItem;
import com.nis.domain.configuration.WebsiteDomainTopic;
import com.nis.domain.dashboard.TrafficIpActiveStatistic;
import com.nis.util.CodeDicUtils;
import com.nis.util.Constants;
import com.nis.util.DateUtil;
import com.nis.util.DictUtils;
import com.nis.util.StringUtil;
import com.nis.util.httpclient.HttpClientUtil;
import com.nis.web.controller.BaseController;
@@ -382,4 +388,100 @@ public class TrafficStatisticsInfoController extends BaseController {
}
return list;
}
/**
* 网址类型列表
*/
@RequestMapping("webTypeList")
public String webTypeList(Model model){
Calendar cal = Calendar. getInstance ();
cal.setTime(new Date());
String now = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());//获取到完整的时间
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1);
String oneHoursAgo = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());
model.addAttribute("beginDate", oneHoursAgo);
model.addAttribute("endDate", now);
return "/dashboard/trafficWebTypeList";
}
/**
* 网站统计图跟表
*/
@RequestMapping(value="websiteList")
@ResponseBody
public List websiteList(Model model,@RequestParam(required=false)String beginDate,@RequestParam(required=false)String endDate){
Map<String, Object> fromJsonList = new HashMap<String, Object>();
List list = new ArrayList();
String url = Constants.DASHBOARD_URL+Constants.TRAFFIC_WEBSITELIST;
// String url = "http://192.168.11.87:8088/galaxy-service/service/log/v1/"+Constants.TRAFFIC_WEBSITELIST;
try {
url=urlAddDate(url,beginDate,endDate);
String string = HttpClientUtil.get(url);
Gson gson = new GsonBuilder().create();
fromJsonList = gson.fromJson(string, new TypeToken<Map>(){}.getType());
logger.debug("website接口数据"+fromJsonList);
list = (ArrayList) fromJsonList.get("data");
BigDecimal divisor=new BigDecimal(1024*1024*1024);
DecimalFormat df = new DecimalFormat("0.00");
DecimalFormat dl = new DecimalFormat("0");
DecimalFormat pf = new DecimalFormat("0.00%");
Double totalLink=0d;
Double totalGbyte=0d;
Double totalPackets=0d;
for (Object object : list) {
Map m=(Map)object;
Double count=(Double)m.get("count");
totalGbyte+=count;
totalLink+=(Double)m.get("linkNum");
totalPackets+=(Double)m.get("packets");
String format = df.format(count/1024/1024/1024);
m.put("Gbyte", format);
}
List<WebsiteDomainTopic> codeList = appCfgService.getDomainDict(new WebsiteDomainTopic());
Map<Long, String> map = new HashMap<Long,String>();
for (WebsiteDomainTopic websiteDomainTopic : codeList) {
if(!map.containsKey(websiteDomainTopic.getWebsiteServiceId())){
map.put(websiteDomainTopic.getId(),websiteDomainTopic.getDomain());
}
}
for (Object object : list) {
Map m=(Map)object;
Double perLink = ((Double)m.get("linkNum"))/totalLink;
m.put("perLink",pf.format(perLink));
Double perPackets = ((Double)m.get("packets"))/totalPackets;
m.put("perPackets", pf.format(perPackets));
Double perGbyte = ((Double)m.get("count"))/totalGbyte;
m.put("perGbyte", pf.format(perGbyte));
if(map.containsKey(Long.parseLong(dl.format(m.get("webId"))))){
m.put("website", map.get(Long.parseLong(dl.format(m.get("webId")))));
}
}
Collections.sort(list, new Comparator<Object>() {
@Override
public int compare(Object o1, Object o2) {
if(o1==null&&o2!=null){
return 1;
}
if(o1!=null&&o2==null){
return -1;
}
if(o1==null&&o2==null){
return 0;
}
Map m1=(Map)o1;
Map m2=(Map)o2;
if((Double)m1.get("count")==(Double)m2.get("count")){
return 0;
}
int result=((Double)m1.get("count")-(Double)m2.get("count"))>0?-1:1;
return result;
}
});
} catch (Exception e) {
e.printStackTrace();
logger.error("网站域名数据获取错误"+e);
list.add(Maps.newHashMap("error","request_service_failed"));
}
return list;
}
}

View File

@@ -1,19 +1,23 @@
package com.nis.web.controller.log.manipulation;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.ClientProtocolException;
import org.springframework.beans.BeanUtils;
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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -21,8 +25,8 @@ 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.DkBehaviorLog;
import com.nis.domain.log.NtcHttpLog;
import com.nis.domain.maat.LogRecvData;
import com.nis.util.CodeDicUtils;
import com.nis.util.Constants;
@@ -31,6 +35,7 @@ import com.nis.util.StringUtil;
import com.nis.util.httpclient.HttpClientUtil;
import com.nis.web.controller.BaseController;
import com.nis.web.dao.dashboard.codedic.CodeResult;
import com.nis.web.security.UserUtils;
@Controller
@RequestMapping(value = "${adminPath}/log/manipulation/dkbehaviorLogs")
@@ -101,5 +106,110 @@ public class DkBehaviorLogController extends BaseController{
return "/log/manipulation/dkBehaviorList";
}
// Stream配置导出
@RequestMapping(value = "exportStream")
public void exportStream(@ModelAttribute("log") DkBehaviorLog entry, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
String name= "Stream";
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<DkBehaviorLog> page = new PageLog<DkBehaviorLog>(request, response);
Map<String, Object> params=new HashMap<>();
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId());
model.addAttribute("serviceList", serviceList);
if(StringUtil.isEmpty(entry.getAction())){
for(int i=0;i<serviceList.size();i++){
if(serviceList.get(i).getServiceId()!=32 && serviceList.get(i).getServiceId()!=128){
entry.setAction(serviceList.get(i).getAction());
break;
}
}
}
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
//查询值判断
initLogSearchValue(entry,params);
//获取字典信息
List<CodeResult> protocolList=CodeDicUtils.getCodeList("protocolCode");
List<CodeResult> behaviorList=CodeDicUtils.getCodeList("behaviorCode");
List<CodeResult> appList=CodeDicUtils.getCodeList("appCode");
String url = "";
url = Constants.LOG_BASE_URL+Constants.NTC_DKBEHAVIOR_LOG;
String jsonString = HttpClientUtil.getMsg(url,params,request);
Gson gson = new GsonBuilder().create();
//gson泛型支持
LogRecvData<DkBehaviorLog> fromJson = gson.fromJson(jsonString, new TypeToken<LogRecvData<DkBehaviorLog>>(){}.getType());
List<DkBehaviorLog> list=new ArrayList<DkBehaviorLog>();
if (fromJson.getStatus().intValue() == 200) {
Page<DkBehaviorLog> data = fromJson.getData();
list = data.getList();
}
for (DkBehaviorLog l : list) {
l.setFunctionId(entry.getFunctionId());
setLogAction(l, serviceList);
if(l.getLabelProtoId()!=null){
l.setLabelProtoName(getName(l.getLabelProtoId(),protocolList));
}
if(l.getLabelBehavId()!=null){
l.setLabelBehavName(getName(l.getLabelBehavId(),behaviorList));
}
if(l.getLabelAppId()!=null){
l.setLabelAppName(getName(l.getLabelAppId(),appList));
}
}
if(entry.getFunctionId()==407){
hColumns+=",behaviour_type,";
name="protocol_identify";
}else if(entry.getFunctionId()==63){
name="social_app_control";
}else if(entry.getFunctionId()==408){
name="encrypted_tunnel_behavior";
}
titleList.add(name);
classMap.put(name, DkBehaviorLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = "," + hColumns;
noExportMap.put(name, cfgIndexInfoNoExport);
dataMap.put(name, list);
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, name, titleList, classMap,
dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, name, titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error(name +" export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
public String getName(Integer id,List<CodeResult> list){
String name="";
Properties msgProp = getMsgProp();
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;
}
}

View File

@@ -1,5 +1,6 @@
package com.nis.web.controller.log.ntc;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -13,6 +14,7 @@ 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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -20,20 +22,24 @@ 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.NtcAppLog;
import com.nis.domain.log.NtcBGPLog;
import com.nis.domain.log.NtcCollectRadiusLog;
import com.nis.domain.maat.LogRecvData;
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.security.UserUtils;
@Controller
@RequestMapping("${adminPath}/log/ntc/other/bgpLogs")
public class BgpLogController extends BaseController {
@RequestMapping(value = {"list", ""})
public String list(@ModelAttribute("log") NtcBGPLog log, Model model, HttpServletRequest request, HttpServletResponse response) {
@RequestMapping(value = { "list", "" })
public String list(@ModelAttribute("log") NtcBGPLog log, Model model, HttpServletRequest request,
HttpServletResponse response) {
try {
PageLog<NtcBGPLog> page = new PageLog<NtcBGPLog>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
@@ -43,22 +49,23 @@ public class BgpLogController extends BaseController {
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId());
model.addAttribute("serviceList", serviceList);
String url = Constants.LOG_BASE_URL + Constants.NTC_BGP_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcBGPLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcBGPLog>>(){}.getType());
LogRecvData<NtcBGPLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcBGPLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcBGPLog> data=fromJson.getData();
Page<NtcBGPLog> data = fromJson.getData();
page.setCount(data.getCount());
page.setLast(data.getLast());
page.setList(data.getList());
List<NtcBGPLog> list = page.getList();
for (NtcBGPLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l,serviceList);
setLogAction(l, serviceList);
}
model.addAttribute("page", page);
}
@@ -67,8 +74,67 @@ public class BgpLogController extends BaseController {
logger.error("查询失败", e);
addMessageLog(model, e.getMessage());
}
return "/log/ntc/bgpList";
}
// radius配置导出
@RequestMapping(value = "exportBgp")
public void exportBgp(@ModelAttribute("log") NtcBGPLog log, Model model, String hColumns, String types,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
System.out.println("进来了bgp");
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<NtcBGPLog> page = new PageLog<NtcBGPLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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);
String url = Constants.LOG_BASE_URL + Constants.NTC_BGP_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<NtcBGPLog> list = new ArrayList<NtcBGPLog>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcBGPLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcBGPLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcBGPLog> data = fromJson.getData();
list = data.getList();
}
}
titleList.add("bgp_control");
classMap.put("bgp_control", NtcBGPLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = "," + hColumns;
noExportMap.put("bgp_control", cfgIndexInfoNoExport);
dataMap.put("bgp_control", list);
/* } */
if ("csv".equals(types)) {
this._exportCsv(model, request, response, redirectAttributes, "bgp_control", titleList, classMap,
dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "bgp_control", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("bgp_control export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -1,6 +1,7 @@
package com.nis.web.controller.log.ntc;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
@@ -17,6 +18,7 @@ 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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -28,7 +30,11 @@ 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.NtcBGPLog;
import com.nis.domain.log.NtcCollectRadiusLog;
import com.nis.domain.log.NtcCollectVoipLog;
import com.nis.domain.log.NtcCollectVoipLog;
import com.nis.domain.log.NtcCollectVoipLog;
import com.nis.domain.maat.LogRecvData;
import com.nis.util.CodeDicUtils;
@@ -38,13 +44,15 @@ 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;
import com.nis.web.security.UserUtils;
@Controller
@RequestMapping(value = "${adminPath}/log/ntc/ntcCollectVoipLogs")
public class CollectVoipLogController extends BaseController{
public class CollectVoipLogController extends BaseController {
/**
* voip泛收日志
*
* @param model
* @param entry
* @param request
@@ -53,16 +61,17 @@ public class CollectVoipLogController extends BaseController{
* @throws ClientProtocolException
* @throws IOException
*/
@RequestMapping(value={"list",""})
public String list(Model model,@ModelAttribute("log")NtcCollectVoipLog entry,HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException {
@RequestMapping(value = { "list", "" })
public String list(Model model, @ModelAttribute("log") NtcCollectVoipLog entry, HttpServletRequest request,
HttpServletResponse response) throws ClientProtocolException, IOException {
try {
PageLog<NtcCollectVoipLog> page = new PageLog<NtcCollectVoipLog>(request, response);
Map<String, Object> params=new HashMap<>();
Map<String, Object> params = new HashMap<>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
//查询值判断
// 查询值判断
if (StringUtils.isNotBlank(entry.getSearchFoundStartTime())
&& StringUtils.isNotBlank(entry.getSearchFoundEndTime())) {
params.put("searchFoundStartTime", entry.getSearchFoundStartTime());
@@ -118,19 +127,19 @@ public class CollectVoipLogController extends BaseController{
}
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId());
model.addAttribute("serviceList", serviceList);
//获取字典信息
List<CodeResult> protocolList=CodeDicUtils.getCodeList("protocolCode");
List<CodeResult> behaviorList=CodeDicUtils.getCodeList("behaviorCode");
List<CodeResult> appList=CodeDicUtils.getCodeList("appCode");
// 获取字典信息
List<CodeResult> protocolList = CodeDicUtils.getCodeList("protocolCode");
List<CodeResult> behaviorList = CodeDicUtils.getCodeList("behaviorCode");
List<CodeResult> appList = CodeDicUtils.getCodeList("appCode");
model.addAttribute("protocolList", protocolList);
model.addAttribute("behaviorList", behaviorList);
model.addAttribute("appList", appList);
String url = "";
url = Constants.LOG_BASE_URL+Constants.NTC_COLLECT_VOIP_LOG;
String jsonString = HttpClientUtil.getMsg(url,params,request);
url = Constants.LOG_BASE_URL + Constants.NTC_COLLECT_VOIP_LOG;
String jsonString = HttpClientUtil.getMsg(url, params, request);
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Date.class, new JsonDeserializer<Date>() {
@@ -140,9 +149,11 @@ public class CollectVoipLogController extends BaseController{
}
});
Gson gson = builder.setDateFormat("yyyy-MM-dd HH:mm:ss").create();
//gson泛型支持
LogRecvData<NtcCollectVoipLog> fromJson = gson.fromJson(jsonString, new TypeToken<LogRecvData<NtcCollectVoipLog>>(){}.getType());
// gson泛型支持
LogRecvData<NtcCollectVoipLog> fromJson = gson.fromJson(jsonString,
new TypeToken<LogRecvData<NtcCollectVoipLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcCollectVoipLog> data = fromJson.getData();
page.setCount(data.getCount());
@@ -157,5 +168,147 @@ public class CollectVoipLogController extends BaseController{
}
return "/log/ntc/collectVoipList";
}
// VoipCollect配置导出
@RequestMapping(value = "exportVoipCollect")
public void exportVoipCollect(@ModelAttribute("log") NtcCollectVoipLog entry, Model model, String hColumns,
String type, HttpServletRequest request, HttpServletResponse response,
RedirectAttributes redirectAttributes) {
try {
PageLog<NtcCollectVoipLog> page = new PageLog<NtcCollectVoipLog>(request, response);
Map<String, Object> params = new HashMap<>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
// 查询值判断
List<NtcCollectVoipLog> list = new ArrayList<NtcCollectVoipLog>();
if (StringUtils.isNotBlank(entry.getSearchFoundStartTime())
&& StringUtils.isNotBlank(entry.getSearchFoundEndTime())) {
params.put("searchFoundStartTime", entry.getSearchFoundStartTime());
params.put("searchFoundEndTime", entry.getSearchFoundEndTime());
} else {
// 判断是否是从配置界面过来的日志查询
if (StringUtils.isNotBlank(entry.getIsLogTotalSearch())) {
Calendar time = Calendar.getInstance();
time.add(Calendar.MINUTE, -5);
String searchEndTime = DateUtils.formatDateTime(time.getTime());
params.put("searchFoundEndTime", searchEndTime);
entry.setSearchFoundEndTime(searchEndTime);
time.add(Calendar.MINUTE, -5);
String searchStartTime = DateUtils.formatDateTime(time.getTime());
params.put("searchFoundStartTime", searchStartTime);
entry.setSearchFoundStartTime(searchStartTime);
} else {
// 设置默认查询当前时间及前五分钟
String endTime = DateUtils.getDateTime();
Date dateStart = new Date(new Date().getTime() - Constants.LOG_TIME_INTERVAL);
String startTime = DateUtils.formatDateTime(dateStart);
params.put("searchFoundStartTime", startTime);
params.put("searchFoundEndTime", endTime);
entry.setSearchFoundStartTime(startTime);
entry.setSearchFoundEndTime(endTime);
}
logger.info("searchFoundStartTime" + params.get("searchFoundStartTime"));
logger.info("searchFoundEndTime" + params.get("searchFoundEndTime"));
}
if (StringUtils.isNotBlank(entry.getVoipProtocol())) {
params.put("searchVoipProtocol", entry.getVoipProtocol());
}
if (StringUtils.isNotBlank(entry.getRtpDIp())) {
params.put("searchRtpDIp", entry.getRtpDIp());
}
if (StringUtils.isNotBlank(entry.getCapIp())) {
params.put("searchCapIp", entry.getCapIp());
}
if (StringUtils.isNotBlank(entry.getRtpSIp())) {
params.put("searchRtpSIp", entry.getRtpSIp());
}
if (StringUtils.isNotBlank(entry.getSipDIp())) {
params.put("searchSipDIp", entry.getSipDIp());
}
if (StringUtils.isNotBlank(entry.getSipSIp())) {
params.put("searchSipSIp", entry.getSipSIp());
}
if (StringUtils.isNotBlank(entry.getOrderBy())) {
params.put("orderBy", entry.getOrderBy());
}
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId());
model.addAttribute("serviceList", serviceList);
String url = "";
url = Constants.LOG_BASE_URL + Constants.NTC_COLLECT_VOIP_LOG;
String jsonString = HttpClientUtil.getMsg(url, params, request);
GsonBuilder builder = new GsonBuilder();
builder.registerTypeAdapter(Date.class, new JsonDeserializer<Date>() {
public Date deserialize(JsonElement json, java.lang.reflect.Type typeOfT,
JsonDeserializationContext context) throws JsonParseException {
return new Date(json.getAsJsonPrimitive().getAsLong());
}
});
Gson gson = builder.setDateFormat("yyyy-MM-dd HH:mm:ss").create();
// gson泛型支持
LogRecvData<NtcCollectVoipLog> fromJson = gson.fromJson(jsonString,
new TypeToken<LogRecvData<NtcCollectVoipLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcCollectVoipLog> data = fromJson.getData();
list = data.getList();
// list = getList();
}
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
titleList.add("collect_voip");
classMap.put("collect_voip", NtcCollectVoipLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = ",cfg_id,action," + hColumns;
noExportMap.put("collect_voip", cfgIndexInfoNoExport);
dataMap.put("collect_voip", list);
/* } */
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "collect_voip", titleList, classMap,
dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "collect_voip", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("collect_voip export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
public List<NtcCollectVoipLog> getList() {
List<NtcCollectVoipLog> list = new ArrayList<NtcCollectVoipLog>();
for (int i = 0; i < 100; i++) {
NtcCollectVoipLog ntcCollectVoipLog = new NtcCollectVoipLog();
ntcCollectVoipLog.setAction(i);
ntcCollectVoipLog.setCalledAccount("-" + i);
ntcCollectVoipLog.setCallId("11" + i);
ntcCollectVoipLog.setDate(new Date().toString());
ntcCollectVoipLog.setId(1L);
ntcCollectVoipLog.setSearchRtpDIp("123");
ntcCollectVoipLog.setCallId("199199");
ntcCollectVoipLog.setAction(1);
ntcCollectVoipLog.setCapIp("11");
ntcCollectVoipLog.setContacts("aa");
ntcCollectVoipLog.setFromToStoreUrl("tocal");
list.add(ntcCollectVoipLog);
}
return list;
}
}

View File

@@ -1,6 +1,7 @@
package com.nis.web.controller.log.ntc;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -15,6 +16,7 @@ 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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -26,13 +28,16 @@ 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.NtcCollectVoipLog;
import com.nis.domain.log.NtcDdosLog;
import com.nis.domain.maat.LogRecvData;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.util.StringUtils;
import com.nis.util.httpclient.HttpClientUtil;
import com.nis.web.controller.BaseController;
import com.nis.web.security.UserUtils;
@Controller
@RequestMapping(value = "${adminPath}/log/ntc/ntcDdosLogs")
@@ -104,4 +109,69 @@ public class DdosLogController extends BaseController{
return "/log/ntc/ddosList";
}
// Ddos配置导出
@RequestMapping(value = "exportDdos")
public void exportDdos(@ModelAttribute("log") NtcDdosLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<NtcDdosLog> page = new PageLog<NtcDdosLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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());
System.out.print(log.getFunctionId());
model.addAttribute("serviceList", serviceList);
String url = Constants.LOG_BASE_URL + Constants.NTC_DDOS_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<NtcDdosLog> list = new ArrayList<NtcDdosLog>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcDdosLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcDdosLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcDdosLog> data = fromJson.getData();
list = data.getList();
}
}
for (NtcDdosLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
titleList.add("target_ip_protect");
classMap.put("target_ip_protect", NtcDdosLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = "," + hColumns;
noExportMap.put("target_ip_protect", cfgIndexInfoNoExport);
dataMap.put("target_ip_protect", list);
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "target_ip_protect", titleList, classMap, dataMap,
noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "target_ip_protect", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("DDOS export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -1,5 +1,6 @@
package com.nis.web.controller.log.ntc;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -13,6 +14,7 @@ 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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -21,20 +23,23 @@ 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.NtcDdosLog;
import com.nis.domain.SysUser;
import com.nis.domain.log.NtcCollectRadiusLog;
import com.nis.domain.log.NtcDnsLog;
import com.nis.domain.maat.LogRecvData;
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.security.UserUtils;
@Controller
@RequestMapping("${adminPath}/log/ntc/dns")
public class DnsLogController extends BaseController {
@RequestMapping("list")
public String list(@ModelAttribute("log") NtcDnsLog log, Model model, HttpServletRequest request, HttpServletResponse response) {
public String list(@ModelAttribute("log") NtcDnsLog log, Model model, HttpServletRequest request,
HttpServletResponse response) {
try {
PageLog<NtcDnsLog> page = new PageLog<NtcDnsLog>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
@@ -44,16 +49,17 @@ public class DnsLogController extends BaseController {
params.put("searchQname", log.getQname());
}
initLogSearchValue(log, params);
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId());
model.addAttribute("serviceList", serviceList);
String url = Constants.LOG_BASE_URL + Constants.NTC_DNS_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
Gson gson = new GsonBuilder().create();
LogRecvData<NtcDnsLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcDnsLog>>(){}.getType());
LogRecvData<NtcDnsLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcDnsLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcDnsLog> data = fromJson.getData();
page.setCount(data.getCount());
@@ -62,7 +68,7 @@ public class DnsLogController extends BaseController {
List<NtcDnsLog> list = page.getList();
for (NtcDnsLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l,serviceList);
setLogAction(l, serviceList);
}
model.addAttribute("page", page);
}
@@ -70,7 +76,71 @@ public class DnsLogController extends BaseController {
logger.error("查询失败", e);
addMessageLog(model, e.getMessage());
}
return "/log/ntc/dnsList";
}
// Dns配置导出
@RequestMapping(value = "exportDns")
public void exportDns(@ModelAttribute("log") NtcDnsLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
System.out.println("进来了dns");
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<NtcDnsLog> page = new PageLog<NtcDnsLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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);
String url = Constants.LOG_BASE_URL + Constants.NTC_DNS_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<NtcDnsLog> list = new ArrayList<NtcDnsLog>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcDnsLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcDnsLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcDnsLog> data = fromJson.getData();
list = data.getList();
}
}
for (NtcDnsLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
titleList.add("DNS");
classMap.put("DNS", NtcDnsLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = "," + hColumns;
noExportMap.put("DNS", cfgIndexInfoNoExport);
dataMap.put("DNS", list);
/* } */
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "DNS", titleList, classMap,
dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "DNS", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("DNS export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -1,6 +1,7 @@
package com.nis.web.controller.log.ntc;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -8,12 +9,14 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.ClientProtocolException;
import org.springframework.beans.BeanUtils;
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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -21,18 +24,21 @@ 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.NtcDnsLog;
import com.nis.domain.log.NtcFtpLog;
import com.nis.domain.log.NtcFtpLog;
import com.nis.domain.log.NtcOpenVpnLog;
import com.nis.domain.maat.LogRecvData;
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.security.UserUtils;
@Controller
@RequestMapping(value = "${adminPath}/log/ntc/NtcFtpLogs")
public class FtpLogController extends BaseController{
public class FtpLogController extends BaseController {
/**
* @param model
@@ -43,29 +49,31 @@ public class FtpLogController extends BaseController{
* @throws ClientProtocolException
* @throws IOException
*/
@RequestMapping(value={"list",""})
public String list(Model model,@ModelAttribute("log")NtcFtpLog entry,HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException {
@RequestMapping(value = { "list", "" })
public String list(Model model, @ModelAttribute("log") NtcFtpLog entry, HttpServletRequest request,
HttpServletResponse response) throws ClientProtocolException, IOException {
try {
PageLog<NtcFtpLog> page = new PageLog<NtcFtpLog>(request, response);
Map<String, Object> params=new HashMap<>();
Map<String, Object> params = new HashMap<>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
//查询值判断
initLogSearchValue(entry,params);
// 查询值判断
initLogSearchValue(entry, params);
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId());
model.addAttribute("serviceList", serviceList);
String url = "";
url = Constants.LOG_BASE_URL+Constants.NTC_FTP_LOG;
String jsonString = HttpClientUtil.getMsg(url,params,request);
url = Constants.LOG_BASE_URL + Constants.NTC_FTP_LOG;
String jsonString = HttpClientUtil.getMsg(url, params, request);
Gson gson = new GsonBuilder().create();
//gson泛型支持
LogRecvData<NtcFtpLog> fromJson = gson.fromJson(jsonString, new TypeToken<LogRecvData<NtcFtpLog>>(){}.getType());
// gson泛型支持
LogRecvData<NtcFtpLog> fromJson = gson.fromJson(jsonString, new TypeToken<LogRecvData<NtcFtpLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcFtpLog> data = fromJson.getData();
page.setCount(data.getCount());
@@ -74,7 +82,7 @@ public class FtpLogController extends BaseController{
List<NtcFtpLog> list = page.getList();
for (NtcFtpLog l : list) {
l.setFunctionId(entry.getFunctionId());
setLogAction(l,serviceList);
setLogAction(l, serviceList);
}
model.addAttribute("page", page);
logger.info("查询Ftp日志成功");
@@ -85,5 +93,68 @@ public class FtpLogController extends BaseController{
}
return "/log/ntc/ftpList";
}
// ftp配置导出
@RequestMapping(value = "exportFtp")
public void exportFtp(@ModelAttribute("log") NtcFtpLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
System.out.println("进来了Ftp");
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<NtcFtpLog> page = new PageLog<NtcFtpLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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);
String url = Constants.LOG_BASE_URL + Constants.NTC_FTP_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<NtcFtpLog> list = new ArrayList<NtcFtpLog>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcFtpLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcFtpLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcFtpLog> data = fromJson.getData();
list = data.getList();
}
}
for (NtcFtpLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
titleList.add("ftp_control");
classMap.put("ftp_control", NtcFtpLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = "," + hColumns;
noExportMap.put("ftp_control", cfgIndexInfoNoExport);
dataMap.put("ftp_control", list);
/* } */
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "ftp_control", titleList, classMap,
dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "ftp_control", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("ftp_control export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -1,5 +1,6 @@
package com.nis.web.controller.log.ntc;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -13,6 +14,7 @@ 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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -20,21 +22,24 @@ 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.NtcFtpLog;
import com.nis.domain.log.NtcHttpLog;
import com.nis.domain.log.NtcKeywordsUrlLog;
import com.nis.domain.log.NtcKeywordsUrlLog;
import com.nis.domain.maat.LogRecvData;
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.security.UserUtils;
@Controller
@RequestMapping("${adminPath}/log/ntc/httpkey")
public class HttpKeyLogController extends BaseController {
@RequestMapping("list")
public String list(@ModelAttribute("log") NtcKeywordsUrlLog log, Model model, HttpServletRequest request, HttpServletResponse response) {
public String list(@ModelAttribute("log") NtcKeywordsUrlLog log, Model model, HttpServletRequest request,
HttpServletResponse response) {
try {
PageLog<NtcKeywordsUrlLog> page = new PageLog<NtcKeywordsUrlLog>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
@@ -44,16 +49,18 @@ public class HttpKeyLogController extends BaseController {
params.put("searchUrl", log.getUrl());
}
initLogSearchValue(log, params);
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId());
model.addAttribute("serviceList", serviceList);
String url = Constants.LOG_BASE_URL + Constants.NTC_KEYWORDS_URL_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
Gson gson = new GsonBuilder().create();
LogRecvData<NtcKeywordsUrlLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcKeywordsUrlLog>>(){}.getType());
LogRecvData<NtcKeywordsUrlLog> fromJson = gson.fromJson(recv,
new TypeToken<LogRecvData<NtcKeywordsUrlLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcKeywordsUrlLog> data = fromJson.getData();
page.setCount(data.getCount());
@@ -62,7 +69,7 @@ public class HttpKeyLogController extends BaseController {
List<NtcKeywordsUrlLog> list = page.getList();
for (NtcKeywordsUrlLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l,serviceList);
setLogAction(l, serviceList);
}
model.addAttribute("page", page);
}
@@ -70,7 +77,72 @@ public class HttpKeyLogController extends BaseController {
logger.error("查询失败", e);
addMessageLog(model, e.getMessage());
}
return "/log/ntc/httpKeyList";
}
// httpKey配置导出
@RequestMapping(value = "exportHttpKey")
public void exportHttpKey(@ModelAttribute("log") NtcKeywordsUrlLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
System.out.println("进来了httpKey");
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<NtcKeywordsUrlLog> page = new PageLog<NtcKeywordsUrlLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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);
String url = Constants.LOG_BASE_URL + Constants.NTC_KEYWORDS_URL_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<NtcKeywordsUrlLog> list = new ArrayList<NtcKeywordsUrlLog>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcKeywordsUrlLog> fromJson = gson.fromJson(recv,
new TypeToken<LogRecvData<NtcKeywordsUrlLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcKeywordsUrlLog> data = fromJson.getData();
list = data.getList();
}
}
for (NtcKeywordsUrlLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
titleList.add("http_keyword");
classMap.put("http_keyword", NtcKeywordsUrlLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = "," + hColumns;
noExportMap.put("http_keyword", cfgIndexInfoNoExport);
dataMap.put("http_keyword", list);
/* } */
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "http_keyword", titleList, classMap,
dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "http_keyword", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("http_keyword export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -1,5 +1,6 @@
package com.nis.web.controller.log.ntc;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -12,6 +13,7 @@ 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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -19,19 +21,23 @@ 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.NtcHttpLog;
import com.nis.domain.log.NtcHttpLog;
import com.nis.domain.maat.LogRecvData;
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.security.UserUtils;
@Controller
@RequestMapping("${adminPath}/log/ntc/http")
public class HttpLogController extends BaseController {
@RequestMapping("list")
public String list(@ModelAttribute("log") NtcHttpLog log, Model model, HttpServletRequest request, HttpServletResponse response) {
public String list(@ModelAttribute("log") NtcHttpLog log, Model model, HttpServletRequest request,
HttpServletResponse response) {
try {
PageLog<NtcHttpLog> page = new PageLog<NtcHttpLog>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
@@ -41,32 +47,33 @@ public class HttpLogController extends BaseController {
params.put("searchUrl", log.getUrl());
}
initLogSearchValue(log, params);
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId());
serviceList.addAll(DictUtils.getFunctionServiceDictList(635));
for (FunctionServiceDict serviceDict : serviceList) {
if(serviceDict.getFunctionId() == log.getFunctionId()){
if(serviceDict.getAction() == Constants.MONIT_ACTION){
if (serviceDict.getFunctionId() == log.getFunctionId()) {
if (serviceDict.getAction() == Constants.MONIT_ACTION) {
serviceDict.setActionCode("log_search_http_monit");
}else if(serviceDict.getAction() == Constants.REJECT_ACTION){
} else if (serviceDict.getAction() == Constants.REJECT_ACTION) {
serviceDict.setActionCode("log_search_http_reject");
}
}else{
if(serviceDict.getAction() == Constants.MONIT_ACTION){
} else {
if (serviceDict.getAction() == Constants.MONIT_ACTION) {
serviceDict.setActionCode("log_search_keyword_monit");
}else if(serviceDict.getAction() == Constants.REJECT_ACTION){
} else if (serviceDict.getAction() == Constants.REJECT_ACTION) {
serviceDict.setActionCode("log_search_keyword_reject");
}
}
}
model.addAttribute("serviceList", serviceList);
String url = Constants.LOG_BASE_URL + Constants.NTC_HTTP_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
Gson gson = new GsonBuilder().create();
LogRecvData<NtcHttpLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcHttpLog>>(){}.getType());
LogRecvData<NtcHttpLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcHttpLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcHttpLog> data = fromJson.getData();
page.setCount(data.getCount());
@@ -75,7 +82,7 @@ public class HttpLogController extends BaseController {
List<NtcHttpLog> list = page.getList();
for (NtcHttpLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l,serviceList);
setLogAction(l, serviceList);
}
model.addAttribute("page", page);
}
@@ -83,7 +90,70 @@ public class HttpLogController extends BaseController {
logger.error("查询失败", e);
addMessageLog(model, e.getMessage());
}
return "/log/ntc/httpList";
}
// http配置导出
@RequestMapping(value = "exportHttp")
public void exportHttp(@ModelAttribute("log") NtcHttpLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<NtcHttpLog> page = new PageLog<NtcHttpLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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);
String url = Constants.LOG_BASE_URL + Constants.NTC_HTTP_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<NtcHttpLog> list = new ArrayList<NtcHttpLog>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcHttpLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcHttpLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcHttpLog> data = fromJson.getData();
list = data.getList();
}
}
for (NtcHttpLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
titleList.add("HTTP");
classMap.put("HTTP", NtcHttpLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",req_hdr_key,req_hdr_file,req_body_key,req_body_file,res_hdr_key,res_hdr_file,res_body_key,res_body_file,scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = "," + hColumns;
noExportMap.put("HTTP", cfgIndexInfoNoExport);
dataMap.put("HTTP", list);
/* } */
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "HTTP", titleList, classMap,
dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "HTTP", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("HTTP export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -2,6 +2,7 @@ package com.nis.web.controller.log.ntc;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -17,6 +18,7 @@ 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;
@@ -24,14 +26,17 @@ 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.NtcHttpLog;
import com.nis.domain.log.NtcIpLog;
import com.nis.domain.log.NtcIpLog;
import com.nis.domain.maat.LogRecvData;
import com.nis.exceptions.MaatConvertException;
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.security.UserUtils;
@Controller
@RequestMapping("${adminPath}/log/ntc/ip")
@@ -111,4 +116,69 @@ public class IpLogController extends BaseController {
return "/log/ntc/ipList";
}
// Ip配置导出
@RequestMapping(value = "exportIp")
public void exportIp(@ModelAttribute("log") NtcIpLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<NtcIpLog> page = new PageLog<NtcIpLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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);
String url = Constants.LOG_BASE_URL + Constants.NTC_IP_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<NtcIpLog> list = new ArrayList<NtcIpLog>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcIpLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcIpLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcIpLog> data = fromJson.getData();
list = data.getList();
}
}
for (NtcIpLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
titleList.add("Ip");
classMap.put("Ip", NtcIpLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = "," + hColumns;
noExportMap.put("Ip", cfgIndexInfoNoExport);
dataMap.put("Ip", list);
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "Ip", titleList, classMap,
dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "Ip", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("Ip" +" export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -1,5 +1,6 @@
package com.nis.web.controller.log.ntc;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -14,6 +15,7 @@ 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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -21,27 +23,31 @@ 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.NtcIpLog;
import com.nis.domain.log.NtcMailLog;
import com.nis.domain.log.NtcMailLog;
import com.nis.domain.maat.LogRecvData;
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.security.UserUtils;
@Controller
@RequestMapping("${adminPath}/log/ntc/mail")
public class MailLogController extends BaseController {
@RequestMapping("list")
public String list(@ModelAttribute("log") NtcMailLog log, Model model, HttpServletRequest request, HttpServletResponse response) {
public String list(@ModelAttribute("log") NtcMailLog log, Model model, HttpServletRequest request,
HttpServletResponse response) {
try {
PageLog<NtcMailLog> page = new PageLog<NtcMailLog>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
initLogSearchValue(log, params);
// 增加收/发件人、邮件主题查询
if (StringUtils.isNotBlank(log.getMailTo())) {
params.put("searchMailTo", StringEscapeUtils.unescapeHtml(log.getMailTo()));
@@ -52,16 +58,17 @@ public class MailLogController extends BaseController {
if (StringUtils.isNotBlank(log.getSubject())) {
params.put("searchSubject", StringEscapeUtils.unescapeHtml(log.getSubject()));
}
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId());
model.addAttribute("serviceList", serviceList);
String url = Constants.LOG_BASE_URL + Constants.NTC_MAIL_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcMailLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcMailLog>>(){}.getType());
LogRecvData<NtcMailLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcMailLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcMailLog> data = fromJson.getData();
page.setCount(data.getCount());
@@ -70,7 +77,7 @@ public class MailLogController extends BaseController {
List<NtcMailLog> list = page.getList();
for (NtcMailLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l,serviceList);
setLogAction(l, serviceList);
}
model.addAttribute("page", page);
}
@@ -79,7 +86,71 @@ public class MailLogController extends BaseController {
logger.error("查询失败", e);
addMessageLog(model, e.getMessage());
}
return "/log/ntc/mailList";
}
// Mail配置导出
@RequestMapping(value = "exportMail")
public void exportMail(@ModelAttribute("log") NtcMailLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
System.out.println("进来了Mail");
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<NtcMailLog> page = new PageLog<NtcMailLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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);
String url = Constants.LOG_BASE_URL + Constants.NTC_MAIL_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<NtcMailLog> list = new ArrayList<NtcMailLog>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcMailLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcMailLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcMailLog> data = fromJson.getData();
list = data.getList();
}
}
for (NtcMailLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
titleList.add("mail_control");
classMap.put("mail_control", NtcMailLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = "," + hColumns;
noExportMap.put("mail_control", cfgIndexInfoNoExport);
dataMap.put("mail_control", list);
/* } */
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "mail_control", titleList, classMap,
dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "mail_control", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("mail_control export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -1,6 +1,7 @@
package com.nis.web.controller.log.ntc;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -8,12 +9,14 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.ClientProtocolException;
import org.springframework.beans.BeanUtils;
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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -21,20 +24,24 @@ 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.MmAvIpLog;
import com.nis.domain.log.NtcStreamMediaLog;
import com.nis.domain.log.NtcStreamMediaLog;
import com.nis.domain.maat.LogRecvData;
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.security.UserUtils;
@Controller
@RequestMapping(value = "${adminPath}/log/ntc/mmAvUrlLogs")
public class MmAvUrlLogController extends BaseController{
public class MmAvUrlLogController extends BaseController {
/**
* 音视频url日志
*
* @param model
* @param entry
* @param request
@@ -43,29 +50,32 @@ public class MmAvUrlLogController extends BaseController{
* @throws ClientProtocolException
* @throws IOException
*/
@RequestMapping(value={"list",""})
public String list(Model model,@ModelAttribute("log")NtcStreamMediaLog entry,HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException {
@RequestMapping(value = { "list", "" })
public String list(Model model, @ModelAttribute("log") NtcStreamMediaLog entry, HttpServletRequest request,
HttpServletResponse response) throws ClientProtocolException, IOException {
try {
PageLog<NtcStreamMediaLog> page = new PageLog<NtcStreamMediaLog>(request, response);
Map<String, Object> params=new HashMap<>();
Map<String, Object> params = new HashMap<>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
//查询值判断
initLogSearchValue(entry,params);
// 查询值判断
initLogSearchValue(entry, params);
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId());
model.addAttribute("serviceList", serviceList);
String url = "";
url = Constants.LOG_BASE_URL+Constants.NTC_STREAMMEDIA_LOG;
String jsonString = HttpClientUtil.getMsg(url,params,request);
url = Constants.LOG_BASE_URL + Constants.NTC_STREAMMEDIA_LOG;
String jsonString = HttpClientUtil.getMsg(url, params, request);
Gson gson = new GsonBuilder().create();
//gson泛型支持
LogRecvData<NtcStreamMediaLog> fromJson = gson.fromJson(jsonString, new TypeToken<LogRecvData<NtcStreamMediaLog>>(){}.getType());
// gson泛型支持
LogRecvData<NtcStreamMediaLog> fromJson = gson.fromJson(jsonString,
new TypeToken<LogRecvData<NtcStreamMediaLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcStreamMediaLog> data = fromJson.getData();
page.setCount(data.getCount());
@@ -74,7 +84,7 @@ public class MmAvUrlLogController extends BaseController{
List<NtcStreamMediaLog> list = page.getList();
for (NtcStreamMediaLog l : list) {
l.setFunctionId(entry.getFunctionId());
setLogAction(l,serviceList);
setLogAction(l, serviceList);
}
model.addAttribute("page", page);
logger.info("查询音视频url日志成功");
@@ -85,5 +95,70 @@ public class MmAvUrlLogController extends BaseController{
}
return "/log/ntc/ntcStreamMedia";
}
// AvUrl配置导出
@RequestMapping(value = "exportAvUrl")
public void exportAvUrl(@ModelAttribute("log") NtcStreamMediaLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
System.out.println("进来了AvUrl");
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<NtcStreamMediaLog> page = new PageLog<NtcStreamMediaLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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);
String url = Constants.LOG_BASE_URL + Constants.NTC_STREAMMEDIA_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<NtcStreamMediaLog> list = new ArrayList<NtcStreamMediaLog>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcStreamMediaLog> fromJson = gson.fromJson(recv,
new TypeToken<LogRecvData<NtcStreamMediaLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcStreamMediaLog> data = fromJson.getData();
list = data.getList();
}
}
for (NtcStreamMediaLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
titleList.add("streaming_media");
classMap.put("streaming_media", NtcStreamMediaLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = "," + hColumns;
noExportMap.put("streaming_media", cfgIndexInfoNoExport);
dataMap.put("streaming_media", list);
/* } */
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "streaming_media", titleList, classMap,
dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "streaming_media", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("streaming_media export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -1,6 +1,7 @@
package com.nis.web.controller.log.ntc;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -14,6 +15,7 @@ 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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -21,20 +23,24 @@ 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.MmFileDigestLog;
import com.nis.domain.log.NtcStreamMediaLog;
import com.nis.domain.maat.LogRecvData;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.util.StringUtils;
import com.nis.util.httpclient.HttpClientUtil;
import com.nis.web.controller.BaseController;
import com.nis.web.security.UserUtils;
@Controller
@RequestMapping(value = "${adminPath}/log/ntc/mmFileDigestLogs")
public class MmFileDigestLogController extends BaseController{
public class MmFileDigestLogController extends BaseController {
/**
* 音视频url日志
*
* @param model
* @param entry
* @param request
@@ -43,29 +49,32 @@ public class MmFileDigestLogController extends BaseController{
* @throws ClientProtocolException
* @throws IOException
*/
@RequestMapping(value={"list",""})
public String list(Model model,@ModelAttribute("log")MmFileDigestLog entry,HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException {
@RequestMapping(value = { "list", "" })
public String list(Model model, @ModelAttribute("log") MmFileDigestLog entry, HttpServletRequest request,
HttpServletResponse response) throws ClientProtocolException, IOException {
try {
PageLog<MmFileDigestLog> page = new PageLog<MmFileDigestLog>(request, response);
Map<String, Object> params=new HashMap<>();
Map<String, Object> params = new HashMap<>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
//查询值判断
initLogSearchValue(entry,params);
// 查询值判断
initLogSearchValue(entry, params);
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId());
model.addAttribute("serviceList", serviceList);
String url = "";
url = Constants.LOG_BASE_URL+Constants.NTC_MMFILEDIGEST_LOG;
String jsonString = HttpClientUtil.getMsg(url,params,request);
url = Constants.LOG_BASE_URL + Constants.NTC_MMFILEDIGEST_LOG;
String jsonString = HttpClientUtil.getMsg(url, params, request);
Gson gson = new GsonBuilder().create();
//gson泛型支持
LogRecvData<MmFileDigestLog> fromJson = gson.fromJson(jsonString, new TypeToken<LogRecvData<MmFileDigestLog>>(){}.getType());
// gson泛型支持
LogRecvData<MmFileDigestLog> fromJson = gson.fromJson(jsonString,
new TypeToken<LogRecvData<MmFileDigestLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<MmFileDigestLog> data = fromJson.getData();
page.setCount(data.getCount());
@@ -74,7 +83,7 @@ public class MmFileDigestLogController extends BaseController{
List<MmFileDigestLog> list = page.getList();
for (MmFileDigestLog l : list) {
l.setFunctionId(entry.getFunctionId());
setLogAction(l,serviceList);
setLogAction(l, serviceList);
}
model.addAttribute("page", page);
logger.info("查询文件摘要日志成功");
@@ -85,5 +94,69 @@ public class MmFileDigestLogController extends BaseController{
}
return "/log/ntc/mmFileDigestList";
}
// FileDigest配置导出
@RequestMapping(value = "exportFileDigest")
public void exportFileDigest(@ModelAttribute("log") MmFileDigestLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<MmFileDigestLog> page = new PageLog<MmFileDigestLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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());
System.out.print(log.getFunctionId());
model.addAttribute("serviceList", serviceList);
String url = Constants.LOG_BASE_URL + Constants.NTC_MMFILEDIGEST_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<MmFileDigestLog> list = new ArrayList<MmFileDigestLog>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<MmFileDigestLog> fromJson = gson.fromJson(recv,
new TypeToken<LogRecvData<MmFileDigestLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<MmFileDigestLog> data = fromJson.getData();
list = data.getList();
}
}
for (MmFileDigestLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
titleList.add("file_digest_control");
classMap.put("file_digest_control", MmFileDigestLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = ",log_uri,direction," + hColumns;
noExportMap.put("file_digest_control", cfgIndexInfoNoExport);
dataMap.put("file_digest_control", list);
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "file_digest_control", titleList, classMap, dataMap,
noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "file_digest_control", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("FileDiges export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -1,5 +1,6 @@
package com.nis.web.controller.log.ntc;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -12,6 +13,7 @@ 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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -19,13 +21,16 @@ 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.MmAvIpLog;
import com.nis.domain.log.MmPicUrlLog;
import com.nis.domain.log.MmSampleVideoLog;
import com.nis.domain.maat.LogRecvData;
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.security.UserUtils;
@Controller
@RequestMapping(value = "${adminPath}/log/ntc")
@@ -115,4 +120,66 @@ public class MmPornAvSampleController extends BaseController {
}
return "/log/ntc/mmPornVideoSampleList";
}
//Video配置导出
@RequestMapping(value = "mmSampleVideoLevelLogs/exportVideo")
public void exportVideo(@ModelAttribute("log") MmAvIpLog log, Model model,String hColumns,String type, HttpServletRequest request, HttpServletResponse response,RedirectAttributes redirectAttributes){
try {
//export data info
List<String> titleList=new ArrayList<String>();
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
//---------------------------
PageLog<MmAvIpLog> page = new PageLog<MmAvIpLog>(request, response);
Map<String, Object> params=new HashMap<>();
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<MmAvIpLog> list=new ArrayList<MmAvIpLog>();
String url = "";
url = Constants.LOG_BASE_URL + Constants.NTC_MMPORNVIDEOSAMPLE_LOG;
String jsonString = HttpClientUtil.getMsg(url,params,request);
Gson gson = new GsonBuilder().create();
//gson泛型支持
LogRecvData<MmAvIpLog> fromJson = gson.fromJson(jsonString, new TypeToken<LogRecvData<MmAvIpLog>>(){}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<MmAvIpLog> data = fromJson.getData();
list= data.getList();
}
for (MmAvIpLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l,serviceList);
}
titleList.add("av_sample_video_porn_control");
classMap.put("av_sample_video_porn_control", MmSampleVideoLog.class);
SysUser user =UserUtils.getUser();
if (!user.isAdmin()){
hColumns+=",scene_file,";
}else{
hColumns+=",";
}
String cfgIndexInfoNoExport=","+hColumns;
noExportMap.put("av_sample_video_porn_control",cfgIndexInfoNoExport);
dataMap.put("av_sample_video_porn_control",list);
/*}*/
if("csv".equals(type)){
this._exportCsv(model, request, response, redirectAttributes,"av_sample_video_porn_control",titleList,classMap,dataMap,noExportMap);
}else{
this._export(model, request, response, redirectAttributes,"av_sample_video_porn_control",titleList,classMap,dataMap,noExportMap);
}
} catch (Exception e) {
logger.error("Video export failed",e);
addMessage(redirectAttributes,"error","export_failed");
}
}
}

View File

@@ -1,5 +1,6 @@
package com.nis.web.controller.log.ntc;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -12,6 +13,7 @@ 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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -19,13 +21,16 @@ 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.MmAvIpLog;
import com.nis.domain.log.MmSampleAudioLog;
import com.nis.domain.maat.LogRecvData;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.util.StringUtils;
import com.nis.util.httpclient.HttpClientUtil;
import com.nis.web.controller.BaseController;
import com.nis.web.security.UserUtils;
@Controller
@RequestMapping(value = "${adminPath}/log/ntc/mmSampleAudioLogs")
@@ -71,4 +76,69 @@ public class MmSampleAudioController extends BaseController{
return "/log/ntc/mmSampleAudioList";
}
// SampleAudio配置导出
@RequestMapping(value = "exportSampleAudio")
public void exportSampleAudio(@ModelAttribute("log") MmSampleAudioLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<MmSampleAudioLog> page = new PageLog<MmSampleAudioLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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());
System.out.print(log.getFunctionId());
model.addAttribute("serviceList", serviceList);
String url = Constants.LOG_BASE_URL + Constants.NTC_DDOS_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<MmSampleAudioLog> list = new ArrayList<MmSampleAudioLog>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<MmSampleAudioLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<MmSampleAudioLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<MmSampleAudioLog> data = fromJson.getData();
list = data.getList();
}
}
for (MmSampleAudioLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
titleList.add("av_sample_audio_control");
classMap.put("av_sample_audio_control", MmSampleAudioLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = ",direction," + hColumns;
noExportMap.put("av_sample_audio_control", cfgIndexInfoNoExport);
dataMap.put("av_sample_audio_control", list);
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "av_sample_audio_control", titleList, classMap, dataMap,
noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "av_sample_audio_control", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("SampleAudio export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -1,6 +1,7 @@
package com.nis.web.controller.log.ntc;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -13,6 +14,7 @@ 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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -20,12 +22,15 @@ 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.MmSamplePicLog;
import com.nis.domain.maat.LogRecvData;
import com.nis.util.Constants;
import com.nis.util.DictUtils;
import com.nis.util.StringUtils;
import com.nis.util.httpclient.HttpClientUtil;
import com.nis.web.controller.BaseController;
import com.nis.web.security.UserUtils;
@Controller
@RequestMapping(value = "${adminPath}/log/ntc/mmSamplePicLogs")
@@ -71,4 +76,64 @@ public class MmSamplePicController extends BaseController{
return "/log/ntc/mmSamplePicList";
}
// SamplePic配置导出
@RequestMapping(value = "exportSamplePic")
public void exportSamplePic(@ModelAttribute("log") MmSamplePicLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
PageLog<MmSamplePicLog> page = new PageLog<MmSamplePicLog>(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<MmSamplePicLog> list=new ArrayList<MmSamplePicLog>();
// 请求接口
String url = Constants.LOG_BASE_URL + Constants.NTC_MMSAMPLEPIC_LOG;
String resJson = HttpClientUtil.getMsg(url, params, request);
Gson gson = new GsonBuilder().create();
LogRecvData<MmSamplePicLog> fromJson = gson.fromJson(resJson, new TypeToken<LogRecvData<MmSamplePicLog>>() {}.getType());
if(fromJson.getStatus().intValue() == 200) {
Page<MmSamplePicLog> data = fromJson.getData();
list = data.getList();
}
for (MmSamplePicLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
titleList.add("SamplePic");
classMap.put("SamplePic", MmSamplePicLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = ",direction," + hColumns;
noExportMap.put("av_sample_picture_control", cfgIndexInfoNoExport);
dataMap.put("av_sample_picture_control", list);
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "av_sample_picture_control", titleList, classMap,
dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "av_sample_picture_control", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("SamplePic export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -1,31 +1,32 @@
package com.nis.web.controller.log.ntc;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.BeanUtils;
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 org.springframework.web.servlet.mvc.support.RedirectAttributes;
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.MmSamplePicLog;
import com.nis.domain.SysUser;
import com.nis.domain.log.MmSampleVideoLog;
import com.nis.domain.maat.LogRecvData;
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.security.UserUtils;
@Controller
@RequestMapping(value = "${adminPath}/log/ntc/mmSampleVideoLogs")
@@ -71,4 +72,69 @@ public class MmSampleVideoController extends BaseController{
return "/log/ntc/mmSampleVideoList";
}
// SampleVideo配置导出
@RequestMapping(value = "exportSampleVideo")
public void exportSampleVideo(@ModelAttribute("log") MmSampleVideoLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<MmSampleVideoLog> page = new PageLog<MmSampleVideoLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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());
System.out.print(log.getFunctionId());
model.addAttribute("serviceList", serviceList);
String url = Constants.LOG_BASE_URL + Constants.NTC_DDOS_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<MmSampleVideoLog> list = new ArrayList<MmSampleVideoLog>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<MmSampleVideoLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<MmSampleVideoLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<MmSampleVideoLog> data = fromJson.getData();
list = data.getList();
}
}
for (MmSampleVideoLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
titleList.add("av_sample_video_control");
classMap.put("av_sample_video_control", MmSampleVideoLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = ",direction," + hColumns;
noExportMap.put("av_sample_video_control", cfgIndexInfoNoExport);
dataMap.put("av_sample_video_control", list);
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "av_sample_video_control", titleList, classMap, dataMap,
noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "av_sample_video_control", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("SampleVideo export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -1,6 +1,7 @@
package com.nis.web.controller.log.ntc;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -8,12 +9,14 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.ClientProtocolException;
import org.springframework.beans.BeanUtils;
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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -21,13 +24,14 @@ 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.MmSampleVideoLog;
import com.nis.domain.SysUser;
import com.nis.domain.log.MmVoipLog;
import com.nis.domain.maat.LogRecvData;
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.security.UserUtils;
@Controller
@RequestMapping(value = "${adminPath}/log/ntc/mmSampleVoipLogs")
@@ -75,4 +79,67 @@ public class MmSampleVoipLogController extends BaseController {
}
return "/log/ntc/mmSampleVoipList";
}
//exportVoip配置导出
@RequestMapping(value = "exportVoip")
public void exportVoip(@ModelAttribute("log") MmVoipLog log, Model model,String hColumns,String type, HttpServletRequest request, HttpServletResponse response,RedirectAttributes redirectAttributes){
try {
//export data info
List<String> titleList=new ArrayList<String>();
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
Map<String, List> dataMap=new HashMap<String, List>();
Map<String, String> noExportMap=new HashMap<String, String>();
//---------------------------
PageLog<MmVoipLog> page = new PageLog<MmVoipLog>(request, response);
Map<String, Object> params=new HashMap<>();
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<MmVoipLog> list=new ArrayList<MmVoipLog>();
String url = Constants.LOG_BASE_URL+Constants.NTC_MMSAMPLE_VOIP_LOG;
String jsonString = HttpClientUtil.getMsg(url,params,request);
Gson gson = new GsonBuilder().create();
//gson泛型支持
LogRecvData<MmVoipLog> fromJson = gson.fromJson(jsonString, new TypeToken<LogRecvData<MmVoipLog>>(){}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<MmVoipLog> data = fromJson.getData();
list= data.getList();
}
for (MmVoipLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l,serviceList);
}
titleList.add("av_sample_voip_control");
classMap.put("av_sample_voip_control", MmVoipLog.class);
SysUser user =UserUtils.getUser();
if (!user.isAdmin()){
hColumns+=",scene_file,";
}else{
hColumns+=",";
}
String cfgIndexInfoNoExport=","+hColumns;
noExportMap.put("av_sample_voip_control",cfgIndexInfoNoExport);
dataMap.put("av_sample_voip_control",list);
/*}*/
if("csv".equals(type)){
this._exportCsv(model, request, response, redirectAttributes,"av_sample_voip_control",titleList,classMap,dataMap,noExportMap);
}else{
this._export(model, request, response, redirectAttributes,"av_sample_voip_control",titleList,classMap,dataMap,noExportMap);
}
} catch (Exception e) {
logger.error("voip export failed",e);
addMessage(redirectAttributes,"error","export_failed");
}
}
}

View File

@@ -1,6 +1,7 @@
package com.nis.web.controller.log.ntc;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -8,12 +9,14 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.ClientProtocolException;
import org.springframework.beans.BeanUtils;
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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -21,16 +24,19 @@ 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.MmVoipLog;
import com.nis.domain.log.MmVoipLog;
import com.nis.domain.maat.LogRecvData;
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.security.UserUtils;
@Controller
@RequestMapping(value = "${adminPath}/log/ntc/mmVoipIpLogs")
public class MmVoipIpLogController extends BaseController{
public class MmVoipIpLogController extends BaseController {
/**
* @param model
@@ -41,29 +47,31 @@ public class MmVoipIpLogController extends BaseController{
* @throws ClientProtocolException
* @throws IOException
*/
@RequestMapping(value={"list",""})
public String list(Model model,@ModelAttribute("log")MmVoipLog entry,HttpServletRequest request, HttpServletResponse response) throws ClientProtocolException, IOException {
@RequestMapping(value = { "list", "" })
public String list(Model model, @ModelAttribute("log") MmVoipLog entry, HttpServletRequest request,
HttpServletResponse response) throws ClientProtocolException, IOException {
try {
PageLog<MmVoipLog> page = new PageLog<MmVoipLog>(request, response);
Map<String, Object> params=new HashMap<>();
Map<String, Object> params = new HashMap<>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
//查询值判断
initLogSearchValue(entry,params);
// 查询值判断
initLogSearchValue(entry, params);
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(entry.getFunctionId());
model.addAttribute("serviceList", serviceList);
String url = "";
url = Constants.LOG_BASE_URL+Constants.NTC_MMVOIP_LOG;
String jsonString = HttpClientUtil.getMsg(url,params,request);
url = Constants.LOG_BASE_URL + Constants.NTC_MMVOIP_LOG;
String jsonString = HttpClientUtil.getMsg(url, params, request);
Gson gson = new GsonBuilder().create();
//gson泛型支持
LogRecvData<MmVoipLog> fromJson = gson.fromJson(jsonString, new TypeToken<LogRecvData<MmVoipLog>>(){}.getType());
// gson泛型支持
LogRecvData<MmVoipLog> fromJson = gson.fromJson(jsonString, new TypeToken<LogRecvData<MmVoipLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<MmVoipLog> data = fromJson.getData();
page.setCount(data.getCount());
@@ -72,7 +80,7 @@ public class MmVoipIpLogController extends BaseController{
List<MmVoipLog> list = page.getList();
for (MmVoipLog l : list) {
l.setFunctionId(entry.getFunctionId());
setLogAction(l,serviceList);
setLogAction(l, serviceList);
}
model.addAttribute("page", page);
logger.info("查询Voip日志成功");
@@ -83,5 +91,69 @@ public class MmVoipIpLogController extends BaseController{
}
return "/log/ntc/mmVoipIpList";
}
// Voip配置导出
@RequestMapping(value = "exportVoip")
public void exportVoip(@ModelAttribute("log") MmVoipLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
System.out.println("进来了Voip");
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<MmVoipLog> page = new PageLog<MmVoipLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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);
String url = Constants.LOG_BASE_URL + Constants.NTC_MMVOIP_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<MmVoipLog> list = new ArrayList<MmVoipLog>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<MmVoipLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<MmVoipLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<MmVoipLog> data = fromJson.getData();
list = data.getList();
}
}
for (MmVoipLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
titleList.add("av_voip_control");
classMap.put("av_voip_control", MmVoipLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",duation,from_to_store_ip,from_to_store_url,to_from_store_ip,to_from_store_url,log_uri,direction,scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = "," + hColumns;
noExportMap.put("av_voip_control", cfgIndexInfoNoExport);
dataMap.put("av_voip_control", list);
/* } */
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "av_voip_control", titleList, classMap,
dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "av_voip_control", titleList, classMap,
dataMap, noExportMap);
}
} catch (Exception e) {
logger.error("av_voip_control export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -18,6 +18,7 @@ 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;
@@ -26,10 +27,12 @@ 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;
@@ -42,43 +45,48 @@ import com.nis.util.StringUtil;
import com.nis.util.httpclient.HttpClientUtil;
import com.nis.web.controller.BaseController;
import com.nis.web.dao.dashboard.codedic.CodeResult;
import com.nis.web.security.UserUtils;
import net.sf.json.JSONObject;
@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) {
@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");
List<CodeResult> appList = CodeDicUtils.getCodeList("appCode");
model.addAttribute("appList", appList);
String url =Constants.LOG_BASE_URL + Constants.NTC_CONN_RECORD_LOG;
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());
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);
}*/
/*
* List<NtcCollectRadiusLog> list = page.getList(); for
* (NtcConnRecordLog l : list) {
* l.setFunctionId(log.getFunctionId());
* setLogAction(l,serviceList); }
*/
model.addAttribute("page", page);
}
}
@@ -86,41 +94,102 @@ public class NtcConnRecordLogController extends BaseController {
logger.error("查询失败", e);
addMessageLog(model, e.getMessage());
}
return "/log/ntc/connRecordLogList";
}
@RequestMapping("/ajaxConnRecordPercent")
@ResponseBody
public JSONObject ajaxConnRecordPercent(String searchFoundStartTime,
String searchFoundEndTime,
String searchStreamDir,
HttpServletRequest request,
HttpServletResponse response) {
JSONObject resultAllJson=new JSONObject();
JSONObject result=new JSONObject();
Map<String, Object> params=new HashMap<>();
public JSONObject ajaxConnRecordPercent(String searchFoundStartTime, String searchFoundEndTime,
String searchStreamDir, HttpServletRequest request, HttpServletResponse response) {
JSONObject resultAllJson = new JSONObject();
JSONObject result = new JSONObject();
Map<String, Object> params = new HashMap<>();
try {
params.put("searchFoundStartTime", searchFoundStartTime);
params.put("searchFoundEndTime", searchFoundEndTime);
StringBuffer url=new StringBuffer(Constants.LOG_BASE_URL+Constants.NTC_CONN_RECORD_PERCENT);
String json=HttpClientUtil.getMsg(url.toString(), params,request);
if(!StringUtil.isEmpty(json)) {
resultAllJson=JSONObject.fromObject(json);
if(!StringUtil.isEmpty(resultAllJson)) {
result=(JSONObject) resultAllJson.get("data");
StringBuffer url = new StringBuffer(Constants.LOG_BASE_URL + Constants.NTC_CONN_RECORD_PERCENT);
String json = HttpClientUtil.getMsg(url.toString(), params, request);
if (!StringUtil.isEmpty(json)) {
resultAllJson = JSONObject.fromObject(json);
if (!StringUtil.isEmpty(resultAllJson)) {
result = (JSONObject) resultAllJson.get("data");
}
}
result.put("success","success");
result.put("success", "success");
} catch (MaatConvertException e) {
logger.error("ajaxConnRecordPercent检索失败",e);
result.put("error",getMsgProp().get("request_service_failed"));
}catch (Exception e) {
logger.error("ajaxConnRecordPercent检索失败",e);
result.put("error",getMsgProp().get("search_error"));
}
logger.error("ajaxConnRecordPercent检索失败", e);
result.put("error", getMsgProp().get("request_service_failed"));
} catch (Exception e) {
logger.error("ajaxConnRecordPercent检索失败", e);
result.put("error", getMsgProp().get("search_error"));
}
return result;
}
// ConnRecord配置导出
@RequestMapping(value = "exportConnRecord")
public void exportConnRecord(@ModelAttribute("log") NtcConnRecordLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
System.out.println("进来了ConnRecord");
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<NtcConnRecordLog> page = new PageLog<NtcConnRecordLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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);
String url = Constants.LOG_BASE_URL + Constants.NTC_CONN_RECORD_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<NtcConnRecordLog> list = new ArrayList<NtcConnRecordLog>();
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();
list = data.getList();
}
}
for (NtcConnRecordLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
titleList.add("conn_record");
classMap.put("conn_record", NtcConnRecordLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = ",cfg_id,action," + hColumns;
noExportMap.put("conn_record", cfgIndexInfoNoExport);
dataMap.put("conn_record", list);
/* } */
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "conn_record", titleList, classMap,
dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "conn_record", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("conn_record export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -1,5 +1,6 @@
package com.nis.web.controller.log.ntc;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -13,6 +14,7 @@ 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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -20,6 +22,8 @@ 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.NtcP2pLog;
import com.nis.domain.log.NtcOpenVpnLog;
import com.nis.domain.log.NtcP2pLog;
import com.nis.domain.maat.LogRecvData;
@@ -27,13 +31,15 @@ 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.security.UserUtils;
@Controller
@RequestMapping("${adminPath}/log/ntc/p2pLogs")
public class P2pLogController extends BaseController {
@RequestMapping(value = {"list", ""})
public String list(@ModelAttribute("log") NtcP2pLog log, Model model, HttpServletRequest request, HttpServletResponse response) {
@RequestMapping(value = { "list", "" })
public String list(@ModelAttribute("log") NtcP2pLog log, Model model, HttpServletRequest request,
HttpServletResponse response) {
try {
PageLog<NtcP2pLog> page = new PageLog<NtcP2pLog>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
@@ -43,13 +49,14 @@ public class P2pLogController extends BaseController {
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId());
model.addAttribute("serviceList", serviceList);
String url = Constants.LOG_BASE_URL + Constants.NTC_P2P_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
String recv = HttpClientUtil.getMsg(url, params, request);
logger.error("查询结果:" + recv);
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcP2pLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcP2pLog>>(){}.getType());
LogRecvData<NtcP2pLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcP2pLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcP2pLog> data = fromJson.getData();
page.setCount(data.getCount());
@@ -58,7 +65,7 @@ public class P2pLogController extends BaseController {
List<NtcP2pLog> list = page.getList();
for (NtcP2pLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l,serviceList);
setLogAction(l, serviceList);
}
model.addAttribute("page", page);
}
@@ -67,8 +74,72 @@ public class P2pLogController extends BaseController {
logger.error("查询失败", e);
addMessageLog(model, e.getMessage());
}
return "/log/ntc/p2pList";
}
// p2p配置导出
@RequestMapping(value = "exportP2p")
public void exportP2p(@ModelAttribute("log") NtcP2pLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
System.out.println("进来了P2p");
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<NtcP2pLog> page = new PageLog<NtcP2pLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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);
String url = Constants.LOG_BASE_URL + Constants.NTC_P2P_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<NtcP2pLog> list = new ArrayList<NtcP2pLog>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcP2pLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcP2pLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcP2pLog> data = fromJson.getData();
list = data.getList();
}
}
for (NtcP2pLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
titleList.add("p2p_control");
classMap.put("p2p_control", NtcP2pLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = "," + hColumns;
noExportMap.put("p2p_control", cfgIndexInfoNoExport);
dataMap.put("p2p_control", list);
/* } */
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "p2p_control", titleList, classMap,
dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "p2p_control", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("p2p_control export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -1,5 +1,6 @@
package com.nis.web.controller.log.ntc;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -12,6 +13,7 @@ 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.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
@@ -20,6 +22,8 @@ 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.NtcSslLog;
import com.nis.domain.log.NtcSshLog;
import com.nis.domain.log.NtcSslLog;
import com.nis.domain.maat.LogRecvData;
@@ -28,35 +32,39 @@ import com.nis.util.DictUtils;
import com.nis.util.StringUtils;
import com.nis.util.httpclient.HttpClientUtil;
import com.nis.web.controller.BaseController;
import com.nis.web.security.UserUtils;
@Controller
@RequestMapping("${adminPath}/log/ntc/sslLogs")
@SuppressWarnings("all")
public class SslLogController extends BaseController {
@RequestMapping(value = {"/list"})
public String list(HttpServletRequest request, HttpServletResponse response, Model model, @ModelAttribute("log")NtcSslLog ntcSslLog) {
PageLog<NtcSslLog> page = new PageLog<NtcSslLog>(request,response);
Map<String, Object> params = new HashMap<String,Object>();
@RequestMapping(value = { "/list" })
public String list(HttpServletRequest request, HttpServletResponse response, Model model,
@ModelAttribute("log") NtcSslLog ntcSslLog) {
PageLog<NtcSslLog> page = new PageLog<NtcSslLog>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
// 请求参数判断
initLogSearchValue(ntcSslLog, params);
if(StringUtils.isNotBlank(ntcSslLog.getSni())) {
if (StringUtils.isNotBlank(ntcSslLog.getSni())) {
params.put("SearchSni", ntcSslLog.getSni());
}
}
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(ntcSslLog.getFunctionId());
model.addAttribute("serviceList", serviceList);
try {
// 请求接口
String url = Constants.LOG_BASE_URL + Constants.NTC_SSL_LOG;
String resJson = HttpClientUtil.getMsg(url, params, request);
Gson gson = new GsonBuilder().create();
LogRecvData<NtcSslLog> fromJson = gson.fromJson(resJson, new TypeToken<LogRecvData<NtcSslLog>>() {}.getType());
if(fromJson.getStatus().intValue() == 200) {
LogRecvData<NtcSslLog> fromJson = gson.fromJson(resJson, new TypeToken<LogRecvData<NtcSslLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcSslLog> data = fromJson.getData();
page.setCount(data.getCount());
page.setLast(data.getLast());
@@ -64,7 +72,7 @@ public class SslLogController extends BaseController {
List<NtcSslLog> list = page.getList();
for (NtcSslLog log : list) {
log.setFunctionId(ntcSslLog.getFunctionId());
setLogAction(log,serviceList);
setLogAction(log, serviceList);
}
model.addAttribute("page", page);
}
@@ -72,7 +80,71 @@ public class SslLogController extends BaseController {
logger.error("SSL日志查询失败", e);
addMessageLog(model, e.getMessage());
}
return "/log/ntc/sslLogList";
}
// Ssl配置导出
@RequestMapping(value = "exportSsl")
public void exportSsl(@ModelAttribute("log") NtcSslLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
System.out.println("进来了ssl");
try {
// export data info
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<NtcSslLog> page = new PageLog<NtcSslLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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);
String url = Constants.LOG_BASE_URL + Constants.NTC_SSL_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<NtcSslLog> list = new ArrayList<NtcSslLog>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcSslLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcSslLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcSslLog> data = fromJson.getData();
list = data.getList();
}
}
for (NtcSslLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
titleList.add("ssl_control");
classMap.put("ssl_control", NtcSslLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = "," + hColumns;
noExportMap.put("ssl_control", cfgIndexInfoNoExport);
dataMap.put("ssl_control", list);
/* } */
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, "ssl_control", titleList, classMap, dataMap,
noExportMap);
} else {
this._export(model, request, response, redirectAttributes, "ssl_control", titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error("ssl_control export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -1,5 +1,6 @@
package com.nis.web.controller.log.pxy;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -7,11 +8,13 @@ import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
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.servlet.mvc.support.RedirectAttributes;
import org.springframework.web.servlet.support.RequestContext;
import com.google.gson.Gson;
@@ -20,6 +23,8 @@ 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.NtcCollectRadiusLog;
import com.nis.domain.log.NtcSslLog;
import com.nis.domain.log.PxyHttpLog;
import com.nis.domain.maat.LogRecvData;
@@ -27,33 +32,35 @@ 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.security.UserUtils;
@Controller
@RequestMapping("${adminPath}/log/pxy")
public class PxyHttpLogController extends BaseController {
@RequestMapping(value = {"list", "ipInterceptlogs", "domainInterceptlogs", "httpBlocklogs",
"httpRedirectlogs", "httpReplacelogs", "httpMonitogs"})
public String list(@ModelAttribute("log") PxyHttpLog log, Model model, HttpServletRequest request, HttpServletResponse response) {
@RequestMapping(value = { "list", "ipInterceptlogs", "domainInterceptlogs", "httpBlocklogs", "httpRedirectlogs",
"httpReplacelogs", "httpMonitogs" })
public String list(@ModelAttribute("log") PxyHttpLog log, Model model, HttpServletRequest request,
HttpServletResponse response) {
try {
setLogInfo(request, model, log);
PageLog<PxyHttpLog> page = new PageLog<PxyHttpLog>(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);
String url = Constants.LOG_BASE_URL + Constants.PXY_HTTP_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
Gson gson = new GsonBuilder().create();
LogRecvData<PxyHttpLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<PxyHttpLog>>(){}.getType());
LogRecvData<PxyHttpLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<PxyHttpLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<PxyHttpLog> data = fromJson.getData();
page.setCount(data.getCount());
@@ -62,24 +69,24 @@ public class PxyHttpLogController extends BaseController {
List<PxyHttpLog> list = page.getList();
for (PxyHttpLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l,serviceList);
setLogAction(l, serviceList);
}
model.addAttribute("page", page);
}
} catch (Exception e) {
logger.error("查询失败", e);
addMessageLog(model, e.getMessage());
}
return "/log/pxy/pxyHttpList";
}
private void setLogInfo(HttpServletRequest request, Model model, PxyHttpLog log) {
int functionId = log.getFunctionId();
RequestContext requestContext = new RequestContext(request);
if (functionId == 200) {
model.addAttribute("logTitle", requestContext.getMessage("ip_intercept"));
log.setAction(1);
@@ -100,4 +107,81 @@ public class PxyHttpLogController extends BaseController {
log.setAction(1);
}
}
// proxy配置导出
@RequestMapping(value = "exportPxy")
public void exportPxy(@ModelAttribute("log") PxyHttpLog log, Model model, String hColumns, String type,
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
String name= "pxy";
try {
// export data info
setLogInfo(request, model, log);
List<String> titleList = new ArrayList<String>();
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
Map<String, List> dataMap = new HashMap<String, List>();
Map<String, String> noExportMap = new HashMap<String, String>();
// ---------------------------
PageLog<PxyHttpLog> page = new PageLog<PxyHttpLog>(request, response);
page.setPageNo(1);
page.setPageSize(Constants.MAX_LOG_EXPORT_SIZE);
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());
System.out.print(log.getFunctionId());
model.addAttribute("serviceList", serviceList);
String url = Constants.LOG_BASE_URL + Constants.PXY_HTTP_LOG;
String recv = HttpClientUtil.getMsg(url, params, request);
List<PxyHttpLog> list = new ArrayList<PxyHttpLog>();
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<PxyHttpLog> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<PxyHttpLog>>() {
}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<PxyHttpLog> data = fromJson.getData();
list = data.getList();
}
}
for (PxyHttpLog l : list) {
l.setFunctionId(log.getFunctionId());
setLogAction(l, serviceList);
}
if(log.getFunctionId()==210){
name="http_monit";
}else if(log.getFunctionId()==207){
name="http_block";
}else if(log.getFunctionId()==208){
name="http_redirect";
}else if(log.getFunctionId()==209){
name="http_replace";
}
titleList.add(name);
classMap.put(name, PxyHttpLog.class);
SysUser user = UserUtils.getUser();
if (!user.isAdmin()) {
hColumns += ",scene_file,";
} else {
hColumns += ",";
}
String cfgIndexInfoNoExport = "," + hColumns;
noExportMap.put(name, cfgIndexInfoNoExport);
dataMap.put(name, list);
if ("csv".equals(type)) {
this._exportCsv(model, request, response, redirectAttributes, name, titleList, classMap,
dataMap, noExportMap);
} else {
this._export(model, request, response, redirectAttributes, name, titleList, classMap, dataMap,
noExportMap);
}
} catch (Exception e) {
logger.error(name +" export failed", e);
addMessage(redirectAttributes, "error", "export_failed");
}
}
}

View File

@@ -1,15 +1,39 @@
package com.nis.web.controller.report;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
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 org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.nis.domain.Page;
import com.nis.domain.PageLog;
import com.nis.domain.SysUser;
import com.nis.domain.log.SearchReport;
import com.nis.domain.maat.LogRecvData;
import com.nis.domain.report.NtcAsnRecord;
import com.nis.domain.report.NtcIpRangeReport;
import com.nis.domain.report.NtcURLReport;
import com.nis.util.Constants;
import com.nis.util.DateUtils;
import com.nis.util.DictUtils;
import com.nis.util.httpclient.HttpClientUtil;
import com.nis.web.controller.BaseController;
import com.nis.web.security.UserUtils;
@Controller
@RequestMapping("${adminPath}/report")
@@ -19,4 +43,170 @@ public class ReportController extends BaseController {
initReportCondition(model, bean);
return "/report/list";
}
//asn
@RequestMapping(value = {"/asnConnList", ""})
public String asnConnLists(@ModelAttribute("log") NtcAsnRecord log, Model model, HttpServletRequest request, HttpServletResponse response) {
try {
PageLog<NtcAsnRecord> page = new PageLog<NtcAsnRecord>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
//判断请求参数
if (StringUtils.isNotBlank(log.getSearchFoundStartTime())
&& StringUtils.isNotBlank(log.getSearchFoundEndTime())) {
params.put("searchFoundStartTime", log.getSearchFoundStartTime());
params.put("searchFoundEndTime", log.getSearchFoundEndTime());
} else {
Calendar time = Calendar.getInstance();
String searchEndTime = DateUtils.formatDateTime(time.getTime());
time.add(Calendar.HOUR_OF_DAY, -1);
String searchStartTime = DateUtils.formatDateTime(time.getTime());
params.put("searchFoundStartTime", searchStartTime);
params.put("searchFoundEndTime", searchEndTime);
log.setSearchFoundStartTime(searchStartTime);
log.setSearchFoundEndTime(searchEndTime);
}
String url =Constants.LOG_BASE_URL + Constants.NTC_ASN_RECORD;
String recv = HttpClientUtil.getMsg(url, params, request);
// String recv="{\"status\":200,\"businessCode\":2001000,\"reason\":\"数据获取操作成功\",\"msg\":\"ASN通联关系(源,目的)检索成功\",\"fromuri\":\"/galaxy-service/service/log/v1/ntcAsnRecord\",\"logSource\":0,\"traceCode\":\"2018121609404451375322\",\"data\":"
// +"{\"pageNo\":1,\"pageSize\":30,\"count\":66564,\"last\":2219,\"list\":[{\"bps\":\"8.56\",\"pps\":\"0.07\",\"sAsn\":\"9198\",\"dAsn\":\"40545_26836\"},"+
// "{\"bps\":\"3.68\",\"pps\":\"0.12\",\"sAsn\":\"9198\",\"dAsn\":\"19506\"},{\"bps\":\"1.77\",\"pps\":\"0.08\",\"sAsn\":\"38266\",\"dAsn\":\"N/A\"},"+
// "{\"bps\":\"493.55\",\"pps\":\"0.76\",\"sAsn\":\"30922\",\"dAsn\":\"29555\"},{\"bps\":\"26.63\",\"pps\":\"0.04\",\"sAsn\":\"44546\",\"dAsn\":\"197482\"},"+
// "{\"bps\":\"25.43\",\"pps\":\"0.45\",\"sAsn\":\"44391\",\"dAsn\":\"9198\"},{\"bps\":\"52.96\",\"pps\":\"0.08\",\"sAsn\":\"29555\",\"dAsn\":\"14080\"}]}}";
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcAsnRecord> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcAsnRecord>>(){}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcAsnRecord> 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 "/report/asnRecordList";
}
//
@RequestMapping(value = {"/httpsUrlList", ""})
public String httpsUrlLists(@ModelAttribute("log") NtcURLReport log, Model model, HttpServletRequest request, HttpServletResponse response) {
try {
PageLog<NtcURLReport> page = new PageLog<NtcURLReport>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
//判断请求参数
if (StringUtils.isNotBlank(log.getSearchReportStartTime())
&& StringUtils.isNotBlank(log.getSearchReportEndTime())) {
params.put("searchReportStartTime", log.getSearchReportStartTime());
params.put("searchReportEndTime", log.getSearchReportEndTime());
} else {
Calendar time = Calendar.getInstance();
String searchEndTime = DateUtils.formatDateTime(time.getTime());
time.add(Calendar.HOUR_OF_DAY, -1);
String searchStartTime = DateUtils.formatDateTime(time.getTime());
params.put("searchReportStartTime", searchStartTime);
params.put("searchReportEndTime", searchEndTime);
log.setSearchReportStartTime(searchStartTime);
log.setSearchReportEndTime(searchEndTime);
}
//url参数
if (StringUtils.isNotBlank(log.getSearchUrl())) {
params.put("searchUrl", log.getSearchUrl());
}
String url =Constants.LOG_BASE_URL + Constants.NTC_URL_REPORT;
String recv = HttpClientUtil.getMsg(url, params, request);
// String recv="{\"status\":200,\"businessCode\":2001000,\"reason\":\"数据获取操作成功\",\"msg\":\"URL统计查询成功\",\"fromuri\":\"/galaxy-service/service/log/v1/ntcURLReport\",\"logSource\":0,\"traceCode\":\"2018121610374649425419\",\"data\":{\"pageNo\":1,\"pageSize\":30,\"count\":174,\"last\":6,\"list\":[{\"url\":\"142.44.167.226/eventproxy/v1/bulk\",\"urlCount\":1686,\"dataList\":[{\"sum\":1686,\"ipAddr\":\"100.101.129.6\"}]},{\"url\":\"188.0.145.98/YZ/e1cib/dlist?cmd=query\",\"urlCount\":2652,\"dataList\":[{\"sum\":1248,\"ipAddr\":\"188.0.145.98\"},{\"sum\":1404,\"ipAddr\":\"89.218.9.2\"}]},{\"url\":\"cdn7.alpha-ag.ru/1c1233923d1a6/c51e872ab5861be256408f6cafa99ed8/luckypatcher_v7.5.9.apk\",\"urlCount\":882,\"dataList\":[{\"sum\":882,\"ipAddr\":\"100.81.118.193\"}]}]}}";
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcURLReport> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcURLReport>>(){}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcURLReport> 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 "/report/urlReportList";
}
//IP范围统计
@RequestMapping(value = {"/ipRangeList", ""})
public String ipRangeLists(@ModelAttribute("log") NtcIpRangeReport log, Model model, HttpServletRequest request, HttpServletResponse response) {
try {
PageLog<NtcIpRangeReport> page = new PageLog<NtcIpRangeReport>(request, response);
Map<String, Object> params = new HashMap<String, Object>();
params.put("pageSize", page.getPageSize());
params.put("pageNo", page.getPageNo());
//判断请求参数
//查询国家
if (StringUtils.isNotBlank(log.getSearchCountry())) {
params.put("searchCountry", log.getSearchCountry());
}
//查询开始IP
if (StringUtils.isNotBlank(log.getSearchStartIp())) {
params.put("searchStartIp", log.getSearchStartIp());
}
//查询结束IP
if (StringUtils.isNotBlank(log.getSearchEndIp())) {
params.put("searchEndIp", log.getSearchEndIp());
}
String url =Constants.LOG_BASE_URL + Constants.NTC_IP_RANGE_REPORT;
String recv = HttpClientUtil.getMsg(url, params, request);
// String recv="{\"status\":200,\"businessCode\":2001000,\"reason\":\"数据获取操作成功\",\"msg\":\"URL统计查询成功\",\"fromuri\":\"/galaxy-service/service/log/v1/ntcIpRangeReport\",\"logSource\":0,\"traceCode\":\"2018121616062785920271\",\"data\":{\"pageNo\":1,\"pageSize\":30,\"count\":0,\"last\":1,\"list\":[{\"ipStart\":\"192.168.10.121\",\"ipEnd\":\"192.168.10.122\",\"ipStartNum\":3232238201,\"ipEndNum\":3232238202,\"ipSub\":\"255.255.255.252\"}]}}";
if (StringUtils.isNotBlank(recv)) {
Gson gson = new GsonBuilder().create();
LogRecvData<NtcIpRangeReport> fromJson = gson.fromJson(recv, new TypeToken<LogRecvData<NtcIpRangeReport>>(){}.getType());
if (fromJson.getStatus().intValue() == 200) {
Page<NtcIpRangeReport> 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 "/report/ipRangeReportList";
}
}