Merge branch 'develop' of https://git.mesalab.cn/K18_NTCS_WEB/NTC.git
into develop Conflicts: src/main/java/com/nis/domain/configuration/CfgIndexInfo.java src/main/resources/nis.properties src/main/webapp/WEB-INF/tags/sys/delRow.tag asn相关功能更改: IP ADDR:增加asn域 1、新增IP ADDR可选asn,如果asn未下发过(is_used=0),下发时asn的group需要标记为commonGroup(groupId为asn组织的groupId,regionId为asn的regionId)。 2、如果所选的asn组(asn组织的groupId)已经下发过(is_used=1),则下发maat时,asn域不需要下发。 3、策略取消时,如果有需要保留的公共组(commongRroupIds),需要将公共组的组号下发。 ASN GROUP: 1、新增asn,如果此asn的组织groupId已下发过(is_used=1),且此组织的groupId已被策略标记过全选(is_audit_all=1),则需要调用公共组域新增的接口,将新增的asn关键字下发。 2、修改asn,如果此asn的组织groupId已下发过(is_used=1),则需要调用公共组域修改的接口,修改已经下发的asn关键字域。 3、删除asn,如果此asn的组织groupId已下发过(is_used=1),则需要调用公共组域删除的接口,删除已经下发的asn关键字域。 ASN IP CFG: 1、新增asn ip,所选asn no的组首次下发(is_valid=0),需要将asn no的groupId标记为公共组;如果asn no非首次下发(is_valid=1),直接调用公共组新增域的接口。 2、修改 生效状态asn ip修改,调用公共组修改域接口直接修改 3、失效 直接调用公共组删除域接口,失效asn ip域
This commit is contained in:
@@ -73,6 +73,7 @@ import com.nis.domain.configuration.DnsResStrategy;
|
||||
import com.nis.domain.configuration.FileDigestCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.domain.configuration.PxyObjKeyring;
|
||||
import com.nis.domain.configuration.PxyObjSpoofingIpPool;
|
||||
import com.nis.domain.configuration.PxyObjTrustedCaCert;
|
||||
import com.nis.domain.configuration.PxyObjTrustedCaCrl;
|
||||
import com.nis.domain.configuration.RequestInfo;
|
||||
@@ -80,6 +81,7 @@ import com.nis.domain.configuration.StringCfgTemplate;
|
||||
import com.nis.domain.configuration.template.AppDomainTemplate;
|
||||
import com.nis.domain.configuration.template.AppPayloadTemplate;
|
||||
import com.nis.domain.configuration.template.AsnIpTemplate;
|
||||
import com.nis.domain.configuration.template.ComplexStringAllNotDoLogTemplate;
|
||||
import com.nis.domain.configuration.template.ComplexStringAllTemplate;
|
||||
import com.nis.domain.configuration.template.DdosIpTemplate;
|
||||
import com.nis.domain.configuration.template.DnsComplexStringTemplate;
|
||||
@@ -98,12 +100,16 @@ import com.nis.domain.configuration.template.HttpsRejectTemplate;
|
||||
import com.nis.domain.configuration.template.HttpsReplaceComplexTemplate;
|
||||
import com.nis.domain.configuration.template.HttpsReplaceIpTemplate;
|
||||
import com.nis.domain.configuration.template.HttpsReplaceTemplate;
|
||||
import com.nis.domain.configuration.template.IpAllNotDoLogTemplate;
|
||||
import com.nis.domain.configuration.template.IpAllTemplate;
|
||||
import com.nis.domain.configuration.template.IpCfgTemplate;
|
||||
import com.nis.domain.configuration.template.IpPayloadTemplate;
|
||||
import com.nis.domain.configuration.template.IpRateLimitTemplate;
|
||||
import com.nis.domain.configuration.template.IpSpoofingTemplate;
|
||||
import com.nis.domain.configuration.template.IpWhitelistTemplate;
|
||||
import com.nis.domain.configuration.template.P2pHashStringTemplate;
|
||||
import com.nis.domain.configuration.template.P2pIpTemplate;
|
||||
import com.nis.domain.configuration.template.StringAllNotDoLogTemplate;
|
||||
import com.nis.domain.configuration.template.StringAllTemplate;
|
||||
import com.nis.domain.configuration.template.TopicWebsiteTemplate;
|
||||
import com.nis.domain.log.BaseLogEntity;
|
||||
@@ -114,7 +120,9 @@ import com.nis.domain.maat.MaatCfg.GroupCfg;
|
||||
import com.nis.domain.maat.MaatCfg.IpCfg;
|
||||
import com.nis.domain.maat.MaatCfg.NumBoundaryCfg;
|
||||
import com.nis.domain.maat.MaatCfg.StringCfg;
|
||||
import com.nis.domain.report.NtcPzReport;
|
||||
import com.nis.domain.maat.ToMaatBean;
|
||||
import com.nis.domain.maat.ToMaatResult;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
@@ -137,6 +145,7 @@ import com.nis.util.excel.thread.CheckDnsResStrategyFormatThread;
|
||||
import com.nis.util.excel.thread.CheckIpFormatThread;
|
||||
import com.nis.util.excel.thread.CheckStringFormatThread;
|
||||
import com.nis.util.excel.thread.CheckTopicWebsiteFormatThread;
|
||||
import com.nis.web.dao.configuration.PxyObjSpoofingIpPoolDao;
|
||||
import com.nis.web.security.UserUtils;
|
||||
import com.nis.web.service.ArchiveServcie;
|
||||
import com.nis.web.service.AreaService;
|
||||
@@ -146,6 +155,7 @@ import com.nis.web.service.LogService;
|
||||
import com.nis.web.service.MenuService;
|
||||
import com.nis.web.service.OfficeService;
|
||||
import com.nis.web.service.RoleService;
|
||||
import com.nis.web.service.SpringContextHolder;
|
||||
import com.nis.web.service.SystemService;
|
||||
import com.nis.web.service.UserService;
|
||||
import com.nis.web.service.basics.AsnGroupInfoService;
|
||||
@@ -193,6 +203,9 @@ import com.nis.web.service.specific.SpecificServiceHostCfgService;
|
||||
import com.nis.web.service.systemService.ServiceConfigInfoService;
|
||||
|
||||
import jersey.repackaged.com.google.common.collect.Maps;
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
import net.sf.json.JsonConfig;
|
||||
|
||||
public class BaseController {
|
||||
|
||||
@@ -1371,6 +1384,9 @@ public class BaseController {
|
||||
BlockingQueue<IpRateLimitTemplate> list = ei.getDataList(IpRateLimitTemplate.class
|
||||
);
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict,null,asnGroupInfos, list);
|
||||
} else if(serviceDict!=null&&serviceDict.getAction().equals(32)) {
|
||||
BlockingQueue<IpAllNotDoLogTemplate> list = ei.getDataList(IpAllNotDoLogTemplate.class );
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,asnGroupInfos, list);
|
||||
} else {
|
||||
BlockingQueue<IpAllTemplate> list = ei.getDataList(IpAllTemplate.class );
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,asnGroupInfos, list);
|
||||
@@ -1410,8 +1426,22 @@ public class BaseController {
|
||||
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||
BlockingQueue<HttpsReplaceIpTemplate> list = ei.getDataList(HttpsReplaceIpTemplate.class );
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,asnGroupInfos, list);
|
||||
}else if(regionDict.getFunctionId().equals(200) && serviceDict.getAction().equals(64)) {// 拦截策略(限速)
|
||||
BlockingQueue<IpRateLimitTemplate> list = ei.getDataList(IpRateLimitTemplate.class );
|
||||
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
||||
BlockingQueue<IpAllNotDoLogTemplate> list = ei.getDataList(IpAllNotDoLogTemplate.class );
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict, null,asnGroupInfos, list);
|
||||
}else if(regionDict.getFunctionId().equals(200)) {// 拦截策略
|
||||
if(serviceDict.getAction().equals(64)) {
|
||||
BlockingQueue<IpRateLimitTemplate> list = ei.getDataList(IpRateLimitTemplate.class );
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict,null,asnGroupInfos, list);
|
||||
}else {
|
||||
BlockingQueue<IpAllNotDoLogTemplate> list = ei.getDataList(IpAllNotDoLogTemplate.class );
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict,null,asnGroupInfos, list);
|
||||
}
|
||||
}else if(regionDict.getFunctionId().equals(3)) { // IP白名单
|
||||
BlockingQueue<IpWhitelistTemplate> list = ei.getDataList(IpWhitelistTemplate.class );
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict,null,asnGroupInfos, list);
|
||||
}else if(regionDict.getFunctionId().equals(214)) { // IpSpoofing
|
||||
BlockingQueue<IpSpoofingTemplate> list = ei.getDataList(IpSpoofingTemplate.class );
|
||||
ipPortCfgs=this.checkIpCfgMulity(errTip,serviceDict, regionDict,null,asnGroupInfos, list);
|
||||
}else {
|
||||
BlockingQueue<IpAllTemplate> list = ei.getDataList(IpAllTemplate.class );
|
||||
@@ -1447,6 +1477,9 @@ public class BaseController {
|
||||
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||
BlockingQueue<HttpsReplaceTemplate> list = ei.getDataList(HttpsReplaceTemplate.class);
|
||||
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
||||
BlockingQueue<StringAllNotDoLogTemplate> list = ei.getDataList(StringAllNotDoLogTemplate.class);
|
||||
stringCfgs=this.checkStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||
}else if(regionDict.getFunctionId().equals(560)){// 主题网站
|
||||
BlockingQueue<TopicWebsiteTemplate> list = ei.getDataList(TopicWebsiteTemplate.class);
|
||||
appTopicDomainCfgs=this.checkTopicWebsiteCfgMulity(errTip,serviceDict, regionDict, list);
|
||||
@@ -1469,6 +1502,9 @@ public class BaseController {
|
||||
} else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||
BlockingQueue<HttpsReplaceComplexTemplate> list = ei.getDataList(HttpsReplaceComplexTemplate.class);
|
||||
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||
} else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
||||
BlockingQueue<ComplexStringAllNotDoLogTemplate> list = ei.getDataList(ComplexStringAllNotDoLogTemplate.class);
|
||||
complexkeywordCfgs = this.checkComplexStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||
} else if(regionDict.getFunctionId().equals(563)){// APP Payload
|
||||
BlockingQueue<AppPayloadTemplate> list = ei.getDataList(AppPayloadTemplate.class);
|
||||
appComplexFeatureCfgs = this.checkAppComplexFeatureStringCfgMulity(errTip,serviceDict, regionDict, list);
|
||||
@@ -1599,6 +1635,145 @@ public class BaseController {
|
||||
_ipPortCfgs.clear();
|
||||
asnIpCfgs.clear();
|
||||
}
|
||||
}else if(regionDict.getFunctionId().intValue()==214) { // IpSpoofing
|
||||
List<BaseIpCfg> _ipPortCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||
while(!ipPortCfgs.isEmpty()) {
|
||||
ipPortCfgs.drainTo(_ipPortCfgs, Constants.MAAT_JSON_SEND_SIZE);
|
||||
List<Integer> compileIds=Lists.newArrayList();
|
||||
List<Integer> spoofingPoolIds=Lists.newArrayList();
|
||||
List<Integer> regionIds=Lists.newArrayList();
|
||||
List<Integer> groupIds=Lists.newArrayList();
|
||||
List<Integer> numRegionGroupIds=Lists.newArrayList();
|
||||
List<Integer> numRegionRegionIds=Lists.newArrayList();
|
||||
List<PxyObjSpoofingIpPool> spoofingPools = new ArrayList<PxyObjSpoofingIpPool>();
|
||||
PxyObjSpoofingIpPoolDao pxyObjSpoofingIpPoolDao = SpringContextHolder.getBean(PxyObjSpoofingIpPoolDao.class);
|
||||
PxyObjSpoofingIpPoolService pxyObjSpoofingIpPoolService = SpringContextHolder.getBean(PxyObjSpoofingIpPoolService.class);
|
||||
try {
|
||||
compileIds = ConfigServiceUtil.getId(1,_ipPortCfgs.size());
|
||||
spoofingPoolIds = ConfigServiceUtil.getId(1,_ipPortCfgs.size());
|
||||
if(isSend.equals("1")) {
|
||||
groupIds = ConfigServiceUtil.getId(2,_ipPortCfgs.size());
|
||||
regionIds = ConfigServiceUtil.getId(3,_ipPortCfgs.size());
|
||||
//需要获取数值域的id
|
||||
if(serviceDict!=null&&serviceDict.getProtocolId()!=null&&serviceDict.getProtocolId()>0) {
|
||||
numRegionGroupIds = ConfigServiceUtil.getId(2,_ipPortCfgs.size());
|
||||
numRegionRegionIds = ConfigServiceUtil.getId(3,_ipPortCfgs.size());
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
|
||||
int ind=0;
|
||||
for (BaseIpCfg cfg : _ipPortCfgs) {
|
||||
cfg.setAction(serviceDict==null?null:serviceDict.getAction());
|
||||
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
cfg.setCreateTime(date);
|
||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
cfg.setFunctionId(regionDict.getFunctionId());
|
||||
if(isSend.equals("1")) {
|
||||
cfg.setIsAudit(Constants.AUDIT_YES);
|
||||
cfg.setIsValid(Constants.VALID_YES);
|
||||
cfg.setAuditorId(UserUtils.getUser().getId());
|
||||
cfg.setAuditTime(date);
|
||||
if(groupIds!=null&&groupIds.size()==_ipPortCfgs.size()) {
|
||||
cfg.setGroupId(groupIds.get(ind));
|
||||
}
|
||||
if(regionIds!=null&®ionIds.size()==_ipPortCfgs.size()) {
|
||||
cfg.setRegionId(regionIds.get(ind));
|
||||
}
|
||||
if(serviceDict!=null&&serviceDict.getProtocolId()!=null) {
|
||||
if(numRegionGroupIds!=null&&numRegionGroupIds.size()==_ipPortCfgs.size()) {
|
||||
cfg.setNumberRegionGroupId(numRegionGroupIds.get(ind));
|
||||
}
|
||||
if(numRegionRegionIds!=null&&numRegionRegionIds.size()==_ipPortCfgs.size()) {
|
||||
cfg.setNumberRegionRegionId(numRegionRegionIds.get(ind));
|
||||
}
|
||||
}
|
||||
}else {
|
||||
cfg.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
cfg.setIsValid(Constants.VALID_NO);
|
||||
}
|
||||
cfg.setIsAreaEffective(0);
|
||||
cfg.setLable("0");
|
||||
cfg.setRequestId(StringUtil.isEmpty(requestId) ? 0 : requestId);
|
||||
cfg.setAttribute(attribute);
|
||||
cfg.setClassify(classify);
|
||||
cfg.setServiceId(serviceDict==null?null:serviceDict.getServiceId());
|
||||
cfg.setTableName("ip_port_cfg");
|
||||
if(compileIds.size()==_ipPortCfgs.size()) {
|
||||
cfg.setCompileId(compileIds.get(ind));
|
||||
}
|
||||
|
||||
// 保存IP仿冒池
|
||||
PxyObjSpoofingIpPool spoofingPool = new PxyObjSpoofingIpPool();
|
||||
spoofingPool.setIpType(4);//ipv4
|
||||
spoofingPool.setIpAddress(cfg.getUserRegion2());//仿冒IP
|
||||
spoofingPool.setProtocol(0);
|
||||
if("dnat".equals(cfg.getUserRegion1().toLowerCase())){//spoofing server ip->dnat
|
||||
spoofingPool.setDirection(1);
|
||||
}else{
|
||||
spoofingPool.setDirection(2);//spoofing client ip->snat
|
||||
}
|
||||
spoofingPool.setPort("0");
|
||||
spoofingPool.setUserRegion("0");
|
||||
spoofingPool.setLocation(0);
|
||||
spoofingPool.setServiceId(642);
|
||||
spoofingPool.setAreaEffectiveIds("0");
|
||||
spoofingPool.setIsAreaEffective(0);
|
||||
spoofingPool.setCreateTime(date);
|
||||
spoofingPool.setCreatorId(UserUtils.getUser().getId());
|
||||
if(spoofingPoolIds.size()==_ipPortCfgs.size()) {
|
||||
spoofingPool.setCompileId(spoofingPoolIds.get(ind));
|
||||
}
|
||||
spoofingPool.setAction(1);
|
||||
spoofingPool.setFunctionId(666);
|
||||
spoofingPool.setRequestId(0);
|
||||
if(isSend.equals("1")) {
|
||||
spoofingPool.setIsAudit(Constants.AUDIT_YES);
|
||||
spoofingPool.setIsValid(Constants.VALID_YES);
|
||||
spoofingPool.setAuditorId(UserUtils.getUser().getId());
|
||||
spoofingPool.setAuditTime(date);
|
||||
|
||||
}else {
|
||||
spoofingPool.setIsValid(Constants.VALID_NO);
|
||||
spoofingPool.setIsAudit(Constants.AUDIT_NOT_YET);
|
||||
|
||||
}
|
||||
pxyObjSpoofingIpPoolDao.insert(spoofingPool);//保存仿冒IP池配置
|
||||
cfg.setUserRegion3(String.valueOf(spoofingPool.getCfgId()));//将仿冒IP池配置ID作为策略组ID
|
||||
|
||||
if(isSend.equals("1")) {
|
||||
PxyObjSpoofingIpPool pool=new PxyObjSpoofingIpPool();
|
||||
pool.setCfgId(Long.valueOf(cfg.getUserRegion3()));
|
||||
pool.setIsValid(cfg.getIsValid());
|
||||
pool.setIsAudit(cfg.getIsAudit());
|
||||
pool.setAuditorId(UserUtils.getUser().getId());
|
||||
pool.setAuditTime(date);
|
||||
pxyObjSpoofingIpPoolDao.update(pool);
|
||||
|
||||
spoofingPool.setAreaEffectiveIds("0");
|
||||
spoofingPool.setGroupId(spoofingPool.getCfgId().intValue());
|
||||
spoofingPools.add(spoofingPool);
|
||||
}
|
||||
|
||||
CfgIndexInfo cfgIndexInfo = new CfgIndexInfo();
|
||||
BeanUtils.copyProperties(cfg, cfgIndexInfo,new String[] {"cfgId"});
|
||||
cfgIndexInfos.add(cfgIndexInfo);
|
||||
|
||||
ind++;
|
||||
}
|
||||
if(isSend.equals("1") && spoofingPools.size()>0) {
|
||||
pxyObjSpoofingIpPoolService.auditSpoofingPool(spoofingPools);
|
||||
}
|
||||
ipCfgService.saveAndSend(regionDict, serviceDict, specificServiceCfg, _ipPortCfgs, cfgIndexInfos, appPolicyCfgs,appFeatureIndexs,asnNoMaps,isSend.equals("1"));
|
||||
cfgIndexInfos.clear();
|
||||
appPolicyCfgs.clear();
|
||||
_ipPortCfgs.clear();
|
||||
}
|
||||
}else {
|
||||
List<BaseIpCfg> _ipPortCfgs=Lists.newArrayList(Constants.MAAT_JSON_SEND_SIZE);
|
||||
while(!ipPortCfgs.isEmpty()) {
|
||||
@@ -1643,7 +1818,7 @@ public class BaseController {
|
||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
cfg.setCreateTime(date);
|
||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
cfg.setDoLog(2);
|
||||
//cfg.setDoLog(2);
|
||||
cfg.setFunctionId(regionDict.getFunctionId());
|
||||
if(isSend.equals("1")) {
|
||||
cfg.setIsAudit(Constants.AUDIT_YES);
|
||||
@@ -1793,7 +1968,7 @@ public class BaseController {
|
||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
cfg.setCreateTime(date);
|
||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
cfg.setDoLog(2);
|
||||
//cfg.setDoLog(2);
|
||||
cfg.setFunctionId(regionDict.getFunctionId());
|
||||
if(isSend.equals("1")) {
|
||||
cfg.setIsAudit(Constants.AUDIT_YES);
|
||||
@@ -1889,7 +2064,7 @@ public class BaseController {
|
||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
cfg.setCreateTime(date);
|
||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
cfg.setDoLog(2);
|
||||
//cfg.setDoLog(2);
|
||||
cfg.setFunctionId(regionDict.getFunctionId());
|
||||
if(isSend.equals("1")) {
|
||||
cfg.setIsAudit(Constants.AUDIT_YES);
|
||||
@@ -1945,12 +2120,12 @@ public class BaseController {
|
||||
for (ComplexkeywordCfg cfg : _complexkeywordCfgs) {
|
||||
cfg.setAction(serviceDict.getAction());
|
||||
/*cfg.setAuditorId(UserUtils.getUser().getId());
|
||||
cfg.setAuditTime(date);*/
|
||||
cfg.setAuditTime(date);*/
|
||||
cfg.setCfgRegionCode(regionDict.getConfigRegionCode());
|
||||
cfg.setCfgType(regionDict.getConfigRegionValue());
|
||||
cfg.setCreateTime(date);
|
||||
cfg.setCreatorId(UserUtils.getUser().getId());
|
||||
cfg.setDoLog(2);
|
||||
//cfg.setDoLog(2);
|
||||
cfg.setFunctionId(regionDict.getFunctionId());
|
||||
if(isSend.equals("1")) {
|
||||
cfg.setIsAudit(Constants.AUDIT_YES);
|
||||
@@ -2235,6 +2410,8 @@ public class BaseController {
|
||||
if (regionDict.getFunctionId().equals(5)) {
|
||||
if (serviceDict!=null&&serviceDict.getAction().equals(64)) {
|
||||
ei.loadInitParams(IpRateLimitTemplate.class, msgProp, regionDict, serviceDict);
|
||||
} else if(serviceDict!=null&&serviceDict.getAction().equals(32)) {
|
||||
ei.loadInitParams(IpAllNotDoLogTemplate.class, msgProp, regionDict, serviceDict);
|
||||
} else {
|
||||
ei.loadInitParams(IpAllTemplate.class, msgProp, regionDict, serviceDict);
|
||||
}
|
||||
@@ -2257,8 +2434,18 @@ public class BaseController {
|
||||
ei.loadInitParams(HttpsRedirectIpTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||
} else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||
ei.loadInitParams(HttpsReplaceIpTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||
} else if(regionDict.getFunctionId().equals(200) && serviceDict.getAction().intValue()==64){// 拦截策略(限速)
|
||||
ei.loadInitParams(IpRateLimitTemplate.class, msgProp, regionDict, serviceDict);
|
||||
} else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
||||
ei.loadInitParams(IpAllNotDoLogTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||
} else if(regionDict.getFunctionId().equals(200)){// 拦截策略
|
||||
if(serviceDict.getAction().intValue()==64) {
|
||||
ei.loadInitParams(IpRateLimitTemplate.class, msgProp, regionDict, serviceDict);
|
||||
}else {
|
||||
ei.loadInitParams(IpAllNotDoLogTemplate.class, msgProp, regionDict, serviceDict);
|
||||
}
|
||||
} else if(regionDict.getFunctionId().equals(3)) { // IP白名单
|
||||
ei.loadInitParams(IpWhitelistTemplate.class, msgProp, regionDict, serviceDict);
|
||||
} else if(regionDict.getFunctionId().equals(214)) { // IpSpoofing
|
||||
ei.loadInitParams(IpSpoofingTemplate.class, msgProp, regionDict, serviceDict);
|
||||
} else {
|
||||
ei.loadInitParams(IpAllTemplate.class, msgProp, regionDict, serviceDict);
|
||||
}
|
||||
@@ -2282,6 +2469,8 @@ public class BaseController {
|
||||
ei.loadInitParams(HttpsRedirectTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||
ei.loadInitParams(HttpsReplaceTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
||||
ei.loadInitParams(StringAllNotDoLogTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||
}else if(regionDict.getFunctionId().equals(560)){// 主题网站
|
||||
ei.loadInitParams(TopicWebsiteTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||
}else {
|
||||
@@ -2297,6 +2486,8 @@ public class BaseController {
|
||||
ei.loadInitParams(HttpsRedirectComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||
}else if(regionDict.getFunctionId().equals(209)){// HTTP(s)替换
|
||||
ei.loadInitParams(HttpsReplaceComplexTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||
}else if(regionDict.getFunctionId().equals(211)){// HTTP(s)白名单
|
||||
ei.loadInitParams(ComplexStringAllNotDoLogTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||
}else if(regionDict.getFunctionId().equals(563)) {// APP Payload
|
||||
ei.loadInitParams(AppPayloadTemplate.class, this.getMsgProp(), regionDict, serviceDict);
|
||||
} else {
|
||||
@@ -3226,5 +3417,91 @@ public class BaseController {
|
||||
|
||||
return hasData;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过serviceIds 和 compileIds获取日志总量
|
||||
* */
|
||||
public List<Map<String, Object>> getLogTotal(Long endTime,String serviceIds,String compileIds){
|
||||
List<Map<String, Object>> dataList=new ArrayList<>();
|
||||
SimpleDateFormat sdf=new SimpleDateFormat(Constants.SEARCH_DATEFORMAT);
|
||||
Date endDate=null;
|
||||
Date startDate=null;
|
||||
if(endTime!=null) {
|
||||
if(StringUtils.isNotBlank(Constants.LOG_TIME_START)) {
|
||||
try {
|
||||
startDate=sdf.parse(Constants.LOG_TIME_START);
|
||||
if(StringUtils.isNotBlank(Constants.LOG_TIME_END)) {
|
||||
endDate=sdf.parse(Constants.LOG_TIME_END);
|
||||
}else {
|
||||
endDate=new Date(endTime);
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}else {
|
||||
Calendar cal=Calendar.getInstance();
|
||||
//分钟间隔
|
||||
int interval=Constants.LOG_TIME_RANGE/1000/60;
|
||||
cal.setTimeInMillis(endTime);
|
||||
if(interval<60) {//5分钟
|
||||
cal.set(Calendar.SECOND, 0);
|
||||
int minute=cal.get(Calendar.MINUTE);
|
||||
cal.set(Calendar.MINUTE,minute/interval*interval);
|
||||
}else {//1小时
|
||||
cal.set(Calendar.SECOND, 0);
|
||||
cal.set(Calendar.MINUTE, 0);
|
||||
}
|
||||
Calendar endTimeCal=Calendar.getInstance();
|
||||
endTimeCal.setTimeInMillis(cal.getTimeInMillis());
|
||||
//endTimeCal.add(Calendar.SECOND, -1);
|
||||
endDate=endTimeCal.getTime();
|
||||
cal.add(Calendar.MINUTE, -interval);
|
||||
startDate=cal.getTime();
|
||||
}
|
||||
logger.info("log search end time:"+sdf.format(endDate));
|
||||
logger.info("log search start time:"+sdf.format(startDate));
|
||||
}
|
||||
List<NtcPzReport> list=null;
|
||||
try {
|
||||
//调用带有超时时间的方法,设置与页面ajax获取total log 超时时间保持一致 页面设置在pzlog.js
|
||||
String json=ConfigServiceUtil.getReport(Constants.BUSINESSTYPE_CONFIG, compileIds, serviceIds, startDate==null?null:sdf.format(startDate), endDate==null?null:sdf.format(endDate),Constants.CLIENT_CONNECT_TIMEOUT,10000);
|
||||
list=getList(json);
|
||||
} catch (Exception e) {
|
||||
logger.error("获取日志总量失败!",e);
|
||||
|
||||
}
|
||||
|
||||
String[] idArr=compileIds.split(",");
|
||||
for(String id:idArr) {
|
||||
Map<String, Object> data=new HashMap<String, Object>();
|
||||
data.put("compileId", id);
|
||||
Long sum=(long) 0;
|
||||
if(list!=null&&(list.size()>0)){
|
||||
for(NtcPzReport report:list) {
|
||||
if(Long.valueOf(id).longValue() == report.getCfgId().longValue()){
|
||||
sum=report.getSum().longValue();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
data.put("sum",sum);
|
||||
dataList.add(data);
|
||||
}
|
||||
return dataList;
|
||||
}
|
||||
public <E> List<E> getList(String json){
|
||||
JSONObject obj=JSONObject.fromObject(json);
|
||||
if(obj.containsKey("data")) {
|
||||
JSONObject data= obj.getJSONObject("data");
|
||||
if(data.containsKey("list")) {
|
||||
Object list=data.get("list");
|
||||
JSONArray array=JSONArray.fromObject(list);
|
||||
List<E> result=JSONArray.toList(array, new NtcPzReport(),new JsonConfig());
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
return new ArrayList<E>();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
package com.nis.web.controller.basics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -97,6 +102,8 @@ public class AsnGroupController extends BaseController {
|
||||
public String delete(RedirectAttributes redirectAttributes,String ids,String asnIds) {
|
||||
try {
|
||||
asnGroupInfoService.delete(ids,asnIds);
|
||||
//TODO 查询本次删除的所有asnOrg组中是否存在asn 没有is_used=0的asn,如果存在则需要将整个组删除
|
||||
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("删除失败",e);
|
||||
@@ -178,5 +185,38 @@ public class AsnGroupController extends BaseController {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 异步获取ASN组织信息
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="ajaxGetAsnOrg")
|
||||
@ResponseBody
|
||||
public List ajaxGetAsnOrg( ConfigGroupInfo orgGroup,Model model){
|
||||
List<ConfigGroupInfo> orgaList=new ArrayList<>();
|
||||
try {
|
||||
orgaList=configGroupInfoService.findAllList(orgGroup);
|
||||
} catch (Exception e) {
|
||||
logger.error("异步获取ASN组织信息失败",e);
|
||||
return orgaList;
|
||||
}
|
||||
return orgaList;
|
||||
}
|
||||
/**
|
||||
* 异步获取ASN组织信息
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="ajaxGetAsnNo")
|
||||
@ResponseBody
|
||||
public List ajaxGetAsnNo(AsnGroupInfo asnGroup,Model model){
|
||||
List<AsnGroupInfo> orgaList=new ArrayList<>();
|
||||
try {
|
||||
orgaList=asnGroupInfoService.findAsnGroupList(asnGroup);
|
||||
} catch (Exception e) {
|
||||
logger.error("异步获取ASN NO信息失败",e);
|
||||
return orgaList;
|
||||
}
|
||||
return orgaList;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,20 @@ public class AsnIpController extends BaseController{
|
||||
asnIpMap.put(Long.parseLong(asnIpCfg.getUserRegion1()), _asnIps);
|
||||
}
|
||||
}
|
||||
asnIpCfgService.auditIpBatch(asnIpMap,isValid);
|
||||
/********************每次下发一个组的region,保证事物********************/
|
||||
for (Long asnId : asnIpMap.keySet()) {
|
||||
try {
|
||||
asnIpCfgService.auditIpBatch(asnIpMap.get(asnId),asnId,isValid);
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}/*else {
|
||||
//条件下所有配置审核
|
||||
Page<AsnIpCfg> searchPage=new Page<AsnIpCfg>(request,response,"a");
|
||||
|
||||
@@ -4,8 +4,10 @@ import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -1706,13 +1708,37 @@ public class AppCfgController extends BaseController {
|
||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");
|
||||
Set<Integer> set=new HashSet<Integer>();
|
||||
for (AppPolicyCfg policy : ipLists) {
|
||||
if(policy.getIsAudit()!=0){
|
||||
set.add(policy.getServiceId());
|
||||
compileIds.append(policy.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", policy.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId());
|
||||
if (app != null) {
|
||||
policy.setSocialName(app.getSpecServiceName());
|
||||
}
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
if(serviceIds.length()>1&&compileIds.length()>1){
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
// 查找社交应用的所有有效二级特定服务
|
||||
SpecificServiceCfg second = new SpecificServiceCfg();
|
||||
for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) {
|
||||
@@ -1726,6 +1752,12 @@ public class AppCfgController extends BaseController {
|
||||
List<SpecificServiceCfg> secondList = specificServiceCfgService.findAllSpecificServiceCfg(second, null);
|
||||
// 遍历,找到匹配项后将行为设置进去
|
||||
for (AppPolicyCfg policy : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(policy.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
policy.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (policy.getBehavCode() == null)
|
||||
continue;
|
||||
for (SpecificServiceCfg secondCfg : secondList) {
|
||||
@@ -1743,7 +1775,7 @@ public class AppCfgController extends BaseController {
|
||||
classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
String cfgIndexInfoNoExport = ",encrypted_tunnel_behavior,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String cfgIndexInfoNoExport = ",do_blacklist,encrypted_tunnel_behavior,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
package com.nis.web.controller.configuration;
|
||||
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -24,15 +29,21 @@ 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.report.NtcPzReport;
|
||||
import com.nis.domain.specific.ConfigGroupInfo;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.exceptions.CallExternalProceduresException;
|
||||
import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.util.ConfigServiceUtil;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
import net.sf.json.JsonConfig;
|
||||
|
||||
/**
|
||||
* 基础协议控制类
|
||||
*
|
||||
@@ -283,20 +294,46 @@ public class BasicProtocolController extends BaseController {
|
||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (AppPolicyCfg policy : ipLists) {
|
||||
if(policy.getIsAudit()!=0){
|
||||
set.add(policy.getServiceId());
|
||||
compileIds.append(policy.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", policy.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId());
|
||||
if (app != null) {
|
||||
policy.setAppName(app.getSpecServiceName());
|
||||
}
|
||||
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
if(serviceIds.length()>1&&compileIds.length()>1){
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_IP");
|
||||
titleList.add("NTC_SUBSCRIBE_ID");
|
||||
classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
String cfgIndexInfoNoExport = ",encrypted_tunnel_behavior,behaviour_type,social_app,behaviour_type,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String cfgIndexInfoNoExport = ",do_blacklist,encrypted_tunnel_behavior,behaviour_type,social_app,behaviour_type,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
@@ -326,6 +363,12 @@ public class BasicProtocolController extends BaseController {
|
||||
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||
List<BaseStringCfg> subscribeInfoList = new ArrayList<BaseStringCfg>();
|
||||
for (AppPolicyCfg cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
AppPolicyCfg cfgIndexInfo = appCfgService.exportIpInfo(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
|
||||
@@ -353,5 +396,5 @@ public class BasicProtocolController extends BaseController {
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,10 @@ package com.nis.web.controller.configuration;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -307,12 +309,37 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
Page<AppPolicyCfg> page = appCfgService.findAppPolicyList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (AppPolicyCfg policy : ipLists) {
|
||||
if(policy.getIsAudit()!=0){
|
||||
set.add(policy.getServiceId());
|
||||
compileIds.append(policy.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", policy.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(policy.getSpecServiceId());
|
||||
if (app != null) {
|
||||
policy.setBehaviorName(app.getSpecServiceName());
|
||||
}
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
if(serviceIds.length()>1&&compileIds.length()>1){
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
// 查找社交应用的所有有效二级特定服务
|
||||
SpecificServiceCfg second = new SpecificServiceCfg();
|
||||
for (SysDataDictionaryItem dict : DictUtils.getDictList("SPECIFIC_SERVICE_CFG_TYPE")) {
|
||||
@@ -343,7 +370,7 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
classMap.put(entity.getMenuNameCode(), AppPolicyCfg.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
String cfgIndexInfoNoExport = ",social_app,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String cfgIndexInfoNoExport = ",do_blacklist,social_app,basic_protocol,expression_type,match_method,whether_hexbinary,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
@@ -373,6 +400,12 @@ public class EncryptedTunnelBehaviorController extends BaseController {
|
||||
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||
List<BaseStringCfg> subscribeInfoList = new ArrayList<BaseStringCfg>();
|
||||
for (AppPolicyCfg cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
AppPolicyCfg cfgIndexInfo = appCfgService.exportIpInfo(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
|
||||
|
||||
@@ -1,14 +1,32 @@
|
||||
package com.nis.web.controller.configuration;
|
||||
|
||||
import java.net.URISyntaxException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
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.http.client.utils.URIBuilder;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.beust.jcommander.internal.Maps;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.nis.domain.log.BaseLogEntity;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.httpclient.HttpClientUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/toLogSearch")
|
||||
@@ -36,4 +54,99 @@ public class LogSearchController extends BaseController{
|
||||
attr.addAttribute("isLogTotalSearch", entity.getIsLogTotalSearch());
|
||||
return "redirect:"+adminPath+logUrl;
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = {"logTrend"})
|
||||
public String logTrend(Model model,BaseLogEntity<Object> entity,String cfgId,String serviceId,RedirectAttributes attr, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
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);
|
||||
model.addAttribute("cfgId", cfgId);
|
||||
model.addAttribute("serviceId", serviceId);
|
||||
return "/cfg/logCfgTrendList";
|
||||
}
|
||||
|
||||
@RequestMapping(value="actionLogTrend")
|
||||
@ResponseBody
|
||||
public List actionTrans(String cfgId,String beginDate,String endDate,String serviceId){
|
||||
Map<String, Object> fromJsonList = new HashMap<String, Object>();
|
||||
List resultList = new ArrayList();
|
||||
String url = Constants.LOG_BASE_URL+Constants.NTC_PZ_REPORT;
|
||||
url=url+"?searchBusinessType=2&searchCfgId="+cfgId;
|
||||
if(!StringUtil.isEmpty(serviceId)){
|
||||
url=url+"&searchService="+serviceId;
|
||||
}
|
||||
try {
|
||||
//String url="http://192.168.10.204:9999/galaxy-service/service/log/v1/ntcPzReport?searchBusinessType=2&searchReportStartTime=2018-12-29%2000:00:00&searchReportEndTime=2018-12-30%2000:00:00";
|
||||
url = urlAddDate(url,beginDate,endDate);
|
||||
//String json=ConfigServiceUtil.getReport(url.toString(), null);
|
||||
String json = HttpClientUtil.get(url);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
fromJsonList = gson.fromJson(json, new TypeToken<Map>(){}.getType());
|
||||
fromJsonList=(Map<String, Object>) fromJsonList.get("data");
|
||||
logger.debug("日志趋势数据"+fromJsonList);
|
||||
JSONObject obj=JSONObject.fromObject(json);
|
||||
resultList =getList(fromJsonList);
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
resultList.add(Maps.newHashMap("error","request_service_failed"));
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
public List getList(Map<String, Object> dateList){
|
||||
List<Map<String,Object>> resultList = new ArrayList<Map<String,Object>>();
|
||||
try {
|
||||
List<Map<String, Object>> mapList=(List<Map<String, Object>>) dateList.get("list");
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Map<String, Object> maps=new HashMap<String,Object>();
|
||||
List<Double[]> list=new ArrayList<Double[]>();
|
||||
Double total=0.0;
|
||||
for (Map<String, Object> map : mapList) {
|
||||
Double[] logs=new Double[2];
|
||||
Double sum=Double.valueOf(String.valueOf(map.get("sum")));
|
||||
Double date=Double.valueOf(sdf.parse(String.valueOf(map.get("reportTime"))).getTime());
|
||||
total+=sum;
|
||||
logs[0]=date;
|
||||
logs[1]=sum;
|
||||
list.add(logs);
|
||||
}
|
||||
maps.put("sum",total);
|
||||
maps.put("result", list);
|
||||
resultList.add(maps);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* url路径时间参数格式化
|
||||
* @param url
|
||||
* @param beginDate
|
||||
* @param endDate
|
||||
* @return
|
||||
* @throws URISyntaxException
|
||||
*/
|
||||
public String urlAddDate(String url,String beginDate,String endDate) throws URISyntaxException{
|
||||
if(StringUtil.isBlank(beginDate)||StringUtil.isBlank(endDate)){
|
||||
Calendar cal = Calendar. getInstance ();
|
||||
cal.setTime(new Date());
|
||||
endDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());//获取到完整的时间
|
||||
cal.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1);
|
||||
beginDate = new SimpleDateFormat( "yyyy-MM-dd HH:mm:00" ).format(cal.getTime());
|
||||
}
|
||||
URIBuilder uriBuilder = new URIBuilder(url);
|
||||
uriBuilder.addParameter("searchReportStartTime",beginDate);
|
||||
uriBuilder.addParameter("searchReportEndTime",endDate);
|
||||
return uriBuilder.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ public class DnsResStrategyController extends BaseController {
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), DnsResStrategy.class);
|
||||
String cfgIndexInfoNoExport = ",cfg_id,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,&config_describe:policy_name-";
|
||||
String cfgIndexInfoNoExport = ",cfg_id,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,&config_describe:policy_name-";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
|
||||
@@ -3,8 +3,10 @@ package com.nis.web.controller.configuration.manipulation;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -159,6 +161,35 @@ public class DdosCfgController extends BaseController {
|
||||
Page<DdosIpCfg> page = ddosCfgService.findPage(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (DdosIpCfg cfg : ipLists) {
|
||||
if(cfg.getIsAudit()!=0){
|
||||
set.add(cfg.getServiceId());
|
||||
compileIds.append(cfg.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", cfg.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
if(serviceIds.length()>1&&compileIds.length()>1){
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!com.nis.util.StringUtils.isBlank(serviceIdsStr)&&!com.nis.util.StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String
|
||||
* id:ids.split(",")){ Long.parseLong(id); } //List<CfgIndexInfo>
|
||||
@@ -169,7 +200,7 @@ public class DdosCfgController extends BaseController {
|
||||
|
||||
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,";
|
||||
String cfgIndexInfoNoExport = ",client_ip,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
@@ -186,6 +217,15 @@ public class DdosCfgController extends BaseController {
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
|
||||
for (DdosIpCfg cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
|
||||
@@ -11,13 +11,16 @@ package com.nis.web.controller.configuration.manipulation;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -451,6 +454,33 @@ public class IpMultiplexController extends CommonController {
|
||||
Page<IpReusePolicyCfg> page = ipMultiplexService.findPage(pageInfo,entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
//日志总量
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (IpReusePolicyCfg cfg : ipLists) {
|
||||
if(cfg.getIsAudit()!=0){
|
||||
set.add(cfg.getServiceId());
|
||||
compileIds.append(cfg.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", cfg.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
List<IpAddrPoolCfg> addrPools = ipAddrPoolCfgService.getEffectiveAddrPool();
|
||||
for (IpReusePolicyCfg ipReusePolicyCfg : ipLists) {
|
||||
if(ipReusePolicyCfg.getAddrPoolId()!=null){
|
||||
@@ -487,6 +517,14 @@ public class IpMultiplexController extends CommonController {
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
||||
for (IpReusePolicyCfg cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
@@ -528,7 +566,34 @@ public class IpMultiplexController extends CommonController {
|
||||
Page<BaseIpCfg> page = ipMultiplexService.findPageDnat(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
|
||||
//日志总量
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (BaseIpCfg cfg : ipLists) {
|
||||
if(cfg.getIsAudit()!=0){
|
||||
set.add(cfg.getServiceId());
|
||||
compileIds.append(cfg.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", cfg.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), IpReuseDnatPolicyCfg.class);
|
||||
String snatNoExport = ",group_name,block_type,direction,client_ip,ip_type,ip_pattern,port_pattern,client_port,ir_type,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
@@ -548,6 +613,14 @@ public class IpMultiplexController extends CommonController {
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
||||
for (BaseIpCfg cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(),ipLists);
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
|
||||
@@ -3,9 +3,11 @@ package com.nis.web.controller.configuration.ntc;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -934,6 +936,35 @@ public class AvContentController extends BaseController {
|
||||
Page<CfgIndexInfo> page = avContentCfgService.findPage(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
if(cfg.getIsAudit()!=0){
|
||||
set.add(cfg.getServiceId());
|
||||
compileIds.append(cfg.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", cfg.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
if(serviceIds.length()>1&&compileIds.length()>1){
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_UNIVERSAL_IP");
|
||||
titleList.add("NTC_STREAMING_MEDIA_URL");
|
||||
@@ -979,6 +1010,12 @@ public class AvContentController extends BaseController {
|
||||
List<BaseStringCfg> subscribeInfoList = new ArrayList<BaseStringCfg>();
|
||||
List<BaseStringCfg> streamurlList = new ArrayList<BaseStringCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
Map<String, List> maps = avContentCfgService.exportstream(cfg);
|
||||
ipList.addAll(maps.get("NTC_UNIVERSAL_IP"));
|
||||
streamurlList.addAll(maps.get("NTC_STREAMING_MEDIA_URL"));
|
||||
@@ -1032,7 +1069,35 @@ public class AvContentController extends BaseController {
|
||||
entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
if(cfg.getIsAudit()!=0){
|
||||
set.add(cfg.getServiceId());
|
||||
compileIds.append(cfg.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", cfg.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
if(serviceIds.length()>1&&compileIds.length()>1){
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_UNIVERSAL_IP");
|
||||
titleList.add("NTC_VOIP_ACCOUNT");
|
||||
@@ -1078,6 +1143,12 @@ public class AvContentController extends BaseController {
|
||||
List<BaseStringCfg> subscribeInfoList = new ArrayList<BaseStringCfg>();
|
||||
List<BaseStringCfg> countlList = new ArrayList<BaseStringCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
Map<String, List> maps = avContentCfgService.exportvoip(cfg);
|
||||
ipList.addAll(maps.get("NTC_UNIVERSAL_IP"));
|
||||
countlList.addAll(maps.get("NTC_VOIP_ACCOUNT"));
|
||||
|
||||
@@ -8,9 +8,11 @@ import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -598,11 +600,41 @@ public class AvController extends BaseController {
|
||||
Page<AvFileSampleCfg> page = avCfgService.getAvFileSampleList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||
|
||||
//日志总量
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (AvFileSampleCfg cfg : ipLists) {
|
||||
if(cfg.getIsAudit()!=0){
|
||||
set.add(cfg.getServiceId());
|
||||
compileIds.append(cfg.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", cfg.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
if(serviceIds.length()>1&&compileIds.length()>1){
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
|
||||
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), AvFileSampleCfg.class);
|
||||
String cfgIndexInfoNoExport = ",group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String cfgIndexInfoNoExport = ",do_log,whether_area_block,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
@@ -619,6 +651,14 @@ public class AvController extends BaseController {
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
for (AvFileSampleCfg cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package com.nis.web.controller.configuration.ntc;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -198,6 +201,36 @@ public class BgpCfgController extends BaseController {
|
||||
Page<CfgIndexInfo> page = bgpCfgService.getBgpList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
if(cfg.getIsAudit()!=0){
|
||||
set.add(cfg.getServiceId());
|
||||
compileIds.append(cfg.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", cfg.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
if(serviceIds.length()>1&&compileIds.length()>1){
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_IP");
|
||||
titleList.add("NTC_BGP_AS");
|
||||
@@ -206,7 +239,7 @@ public class BgpCfgController extends BaseController {
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_BGP_AS", BaseStringCfg.class);
|
||||
// classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String cfgIndexInfoNoExport = ",do_blacklist,policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
@@ -243,6 +276,12 @@ public class BgpCfgController extends BaseController {
|
||||
// ArrayList<BaseStringCfg>();
|
||||
List<BaseStringCfg> asInfoList = new ArrayList<BaseStringCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
CfgIndexInfo cfgIndexInfo = bgpCfgService.exportbgp(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
// subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
|
||||
|
||||
@@ -6,8 +6,10 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -624,6 +626,34 @@ public class FileTransferCfgController extends BaseController {
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
if(cfg.getIsAudit()!=0){
|
||||
set.add(cfg.getServiceId());
|
||||
compileIds.append(cfg.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", cfg.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
if(serviceIds.length()>1&&compileIds.length()>1){
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_UNIVERSAL_IP");
|
||||
titleList.add("NTC_FTP_URL");
|
||||
@@ -673,6 +703,12 @@ public class FileTransferCfgController extends BaseController {
|
||||
List<BaseStringCfg> ftpkeyList = new ArrayList<BaseStringCfg>();
|
||||
List<BaseStringCfg> ftpurlList = new ArrayList<BaseStringCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
Map<String, List> maps = fileTransferCfgService.exportftp(cfg);
|
||||
ftpkeyList.addAll(maps.get("NTC_FTP_CONTENT"));
|
||||
ftpurlList.addAll(maps.get("NTC_FTP_URL"));
|
||||
@@ -730,6 +766,34 @@ public class FileTransferCfgController extends BaseController {
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
if(cfg.getIsAudit()!=0){
|
||||
set.add(cfg.getServiceId());
|
||||
compileIds.append(cfg.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", cfg.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
if(serviceIds.length()>1&&compileIds.length()>1){
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_UNIVERSAL_IP");
|
||||
titleList.add("NTC_P2P_KEYWORDS");
|
||||
@@ -783,6 +847,12 @@ public class FileTransferCfgController extends BaseController {
|
||||
List<BaseStringCfg> hashList = new ArrayList<BaseStringCfg>();
|
||||
List<BaseStringCfg> keywordList = new ArrayList<BaseStringCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
Map<String, List> maps = fileTransferCfgService.exportp2p(cfg);
|
||||
keywordList.addAll(maps.get("NTC_P2P_KEYWORDS"));
|
||||
hashList.addAll(maps.get("NTC_P2P_HASH_BIN"));
|
||||
@@ -838,9 +908,39 @@ public class FileTransferCfgController extends BaseController {
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
//日志总量
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (FileDigestCfg cfg : ipLists) {
|
||||
if(cfg.getIsAudit()!=0){
|
||||
set.add(cfg.getServiceId());
|
||||
compileIds.append(cfg.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", cfg.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
if(serviceIds.length()>1&&compileIds.length()>1){
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), FileDigestCfg.class);
|
||||
String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String cfgIndexInfoNoExport = ",do_log,policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
@@ -856,7 +956,15 @@ public class FileTransferCfgController extends BaseController {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
for (FileDigestCfg cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
/* } */
|
||||
|
||||
|
||||
@@ -5,8 +5,10 @@ import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@@ -249,7 +251,34 @@ public class MailCfgController extends BaseController {
|
||||
Page<CfgIndexInfo> page = mailCfgService.getMailList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
if(cfg.getIsAudit()!=0){
|
||||
set.add(cfg.getServiceId());
|
||||
compileIds.append(cfg.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", cfg.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
if(serviceIds.length()>1&&compileIds.length()>1){
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
@@ -305,6 +334,12 @@ public class MailCfgController extends BaseController {
|
||||
List<ComplexkeywordCfg> mailBodyList = new ArrayList<ComplexkeywordCfg>();
|
||||
List<ComplexkeywordCfg> mailReqHdrList = new ArrayList<ComplexkeywordCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
Map<String, List> maps = mailCfgService.exportmail(cfg);
|
||||
mailReqHdrList.addAll(maps.get("NTC_MAIL_HDR"));
|
||||
mailBodyList.addAll(maps.get("NTC_MAIL_BODY"));
|
||||
|
||||
@@ -3,9 +3,11 @@ package com.nis.web.controller.configuration.ntc;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -626,6 +628,35 @@ public class WebsiteController extends BaseController {
|
||||
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
if(cfg.getIsAudit()!=0){
|
||||
set.add(cfg.getServiceId());
|
||||
compileIds.append(cfg.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", cfg.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
if(serviceIds.length()>1&&compileIds.length()>1){
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||
|
||||
String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
@@ -680,6 +711,12 @@ public class WebsiteController extends BaseController {
|
||||
List<IpPortCfg> ipPortList = new ArrayList<>();
|
||||
List<BaseStringCfg> subscribeIdList = new ArrayList<>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
Map<String, List> maps = websiteCfgService.exportHttpCfg(cfg);
|
||||
httpUrlList.addAll(maps.get("NTC_HTTP_URL"));
|
||||
httpReqHdrList.addAll(maps.get("NTC_HTTP_REQ_HDR"));
|
||||
@@ -774,8 +811,19 @@ public class WebsiteController extends BaseController {
|
||||
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (int i = 0; i < ipLists.size(); i++) {
|
||||
if(ipLists.get(i).getIsAudit()!=0){
|
||||
set.add(ipLists.get(i).getServiceId());
|
||||
compileIds.append(ipLists.get(i).getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", ipLists.get(i).getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
if (ipLists.get(i).getDnsStrategyId() != null && ipLists.get(i).getDnsStrategyId() != 0) {
|
||||
List<DnsResStrategy> resStrategys = dnsResStrategyService
|
||||
.findDnsResStrategys(ipLists.get(i).getDnsStrategyId(), 1, 1);
|
||||
@@ -793,6 +841,20 @@ public class WebsiteController extends BaseController {
|
||||
ipLists.get(i).setDnsStrategyName(msgProp.getProperty("no_strategy"));
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
if(serviceIds.length()>1&&compileIds.length()>1){
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_IP");
|
||||
titleList.add("NTC_DNS_REGION");
|
||||
@@ -801,7 +863,7 @@ public class WebsiteController extends BaseController {
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
classMap.put("NTC_DNS_REGION", ComplexkeywordCfg.class);
|
||||
classMap.put("NTC_SUBSCRIBE_ID", NtcSubscribeIdCfg.class);
|
||||
String cfgIndexInfoNoExport = ",group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String cfgIndexInfoNoExport = ",do_blacklist,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport = ",do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
@@ -837,6 +899,12 @@ public class WebsiteController extends BaseController {
|
||||
List<BaseStringCfg> subscribeInfoList = new ArrayList<BaseStringCfg>();
|
||||
List<ComplexkeywordCfg> regionInfoList = new ArrayList<ComplexkeywordCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
CfgIndexInfo cfgIndexInfo = websiteCfgService.exportdns(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
subscribeInfoList.addAll(cfgIndexInfo.getNtcSubscribeIdCfgList());
|
||||
@@ -892,7 +960,33 @@ public class WebsiteController extends BaseController {
|
||||
Page<CfgIndexInfo> page = websiteCfgService.getWebsiteList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
if(cfg.getIsAudit()!=0){
|
||||
set.add(cfg.getServiceId());
|
||||
compileIds.append(cfg.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", cfg.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
if(serviceIds.length()>1&&compileIds.length()>1){
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_UNIVERSAL_IP");
|
||||
titleList.add("NTC_SSL_SNI");
|
||||
@@ -946,6 +1040,12 @@ public class WebsiteController extends BaseController {
|
||||
List<IpPortCfg> ipPortList = new ArrayList<>();
|
||||
List<BaseStringCfg> subscribeIdList = new ArrayList<BaseStringCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
Map<String, List> maps = websiteCfgService.exportssl(cfg);
|
||||
sslSniList.addAll(maps.get("NTC_SSL_SNI"));
|
||||
sslSnaList.addAll(maps.get("NTC_SSL_SAN"));
|
||||
|
||||
@@ -3,8 +3,10 @@ package com.nis.web.controller.configuration.ntc;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -367,11 +369,42 @@ public class WhiteListController extends CommonController {
|
||||
Page<CfgIndexInfo> page = ipCfgService.getIpCfgList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
//日志总量
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
if(cfg.getIsAudit()!=0){
|
||||
set.add(cfg.getServiceId());
|
||||
compileIds.append(cfg.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", cfg.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
if(serviceIds.length()>1&&compileIds.length()>1){
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_IP");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
classMap.put("NTC_IP", IpPortCfg.class);
|
||||
String cfgIndexInfoNoExport = ",policy_name,do_log,letter,whether_area_block,classification,attribute,label,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String cfgIndexInfoNoExport = ",policy_name,letter,whether_area_block,classification,attribute,label,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
String ipPortInfoNoExport = ",protocol,direction,do_log,action,config_describe,valid_identifier,is_audit,creator,creator"
|
||||
+ ",config_time,editor,edit_time,auditor,audit_time"
|
||||
+ ",letter,whether_area_block,classification,attribute,label"
|
||||
@@ -395,6 +428,12 @@ public class WhiteListController extends CommonController {
|
||||
noExportMap.put("NTC_IP", ipPortInfoNoExport);
|
||||
List<IpPortCfg> ipList = new ArrayList<IpPortCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
CfgIndexInfo cfgIndexInfo = ipCfgService.exportIpInfo(cfg);
|
||||
ipList.addAll(cfgIndexInfo.getIpPortList());
|
||||
}
|
||||
@@ -442,7 +481,32 @@ public class WhiteListController extends CommonController {
|
||||
Page<CfgIndexInfo> page = domainService.getDomainList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
if(cfg.getIsAudit()!=0){
|
||||
set.add(cfg.getServiceId());
|
||||
compileIds.append(cfg.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", cfg.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
}
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
//获取日志总量
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
titleList.add("NTC_HTTP_URL");
|
||||
classMap.put(entity.getMenuNameCode(), CfgIndexInfo.class);
|
||||
@@ -471,6 +535,12 @@ public class WhiteListController extends CommonController {
|
||||
noExportMap.put("NTC_HTTP_URL", httpUrlInfoNoExport);
|
||||
List<BaseStringCfg> httpurlList = new ArrayList<BaseStringCfg>();
|
||||
for (CfgIndexInfo cfg : ipLists) {
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
CfgIndexInfo cfgIndexInfo = domainService.exportDomainInfo(cfg);
|
||||
httpurlList.addAll(cfgIndexInfo.getHttpUrlList());
|
||||
}
|
||||
|
||||
@@ -3,9 +3,11 @@ package com.nis.web.controller.configuration.proxy;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -295,9 +297,27 @@ public class HttpRedirectPolicyController extends BaseController {
|
||||
Page<CfgIndexInfo> page = httpRedirectCfgService.getHttpRedirectList(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//日志总量
|
||||
List<Map<String,Object>> logTotals=new ArrayList<Map<String,Object>>();
|
||||
StringBuilder compileIds=new StringBuilder(",");//配置ids
|
||||
Set<Integer> set=new HashSet<Integer>();//服务ids
|
||||
|
||||
|
||||
Properties prop = getMsgProp();
|
||||
for (CfgIndexInfo str : ipLists) {
|
||||
|
||||
if(str.getIsAudit()!=0){
|
||||
set.add(str.getServiceId());
|
||||
compileIds.append(str.getCompileId()+",");
|
||||
}else{
|
||||
Map<String,Object> logTotal=new HashMap<String,Object>();
|
||||
logTotal.put("compileId", str.getCompileId()+"");
|
||||
logTotal.put("sum",0L);
|
||||
logTotals.add(logTotal);
|
||||
}
|
||||
|
||||
if (entity.getFunctionId() != 210 && entity.getFunctionId() != 211) {
|
||||
String type = "RESPONSE_CODE";
|
||||
if (entity.getFunctionId() == 207) {
|
||||
@@ -324,6 +344,21 @@ public class HttpRedirectPolicyController extends BaseController {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//获取日志总量
|
||||
StringBuilder serviceIds=new StringBuilder(",");
|
||||
if(set.size()>0) {
|
||||
for (Integer id : set) {
|
||||
serviceIds.append(id+",");
|
||||
}
|
||||
String serviceIdsStr=serviceIds.toString().substring(1, serviceIds.length()-1);
|
||||
String compileIdsStr=compileIds.toString().substring(1, compileIds.length()-1);
|
||||
if(!StringUtils.isBlank(serviceIdsStr)&&!StringUtils.isBlank(compileIdsStr)){
|
||||
List<Map<String,Object>> logs = getLogTotal( null,serviceIdsStr,compileIdsStr);
|
||||
logTotals.addAll(logs);
|
||||
}
|
||||
}
|
||||
|
||||
String cfgIndexInfoNoExport = ",policy_name,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
if (entity.getFunctionId() == 207) {
|
||||
cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,userregion5,&userregion1:response_code-userregion2:response_content-";
|
||||
@@ -393,6 +428,14 @@ public class HttpRedirectPolicyController extends BaseController {
|
||||
httpResBodyList.addAll(maps.get("NTC_HTTP_RES_BODY"));
|
||||
ipPortList.addAll(maps.get("NTC_UNIVERSAL_IP"));
|
||||
subscribeIdList.addAll(maps.get("NTC_SUBSCRIBE_ID"));
|
||||
|
||||
for (Map<String,Object> logTotal : logTotals) {
|
||||
if(cfg.getCompileId().equals(Integer.parseInt((String) logTotal.get("compileId")))){
|
||||
cfg.setTotalLogs((Long)logTotal.get("sum"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
httpUrlList = BaseStringCfg.replaceBaseKeyList(httpUrlList);
|
||||
httpReqHdrList = ComplexkeywordCfg.replaceComplexKeyList(httpReqHdrList);
|
||||
|
||||
@@ -329,6 +329,18 @@ public class InterceptController extends CommonController {
|
||||
httpUrlList.addAll(maps.get("NTC_HTTP_URL"));
|
||||
ipList.addAll(maps.get("PXY_INTERCEPT_IP"));
|
||||
pktBinList.addAll(maps.get("PXY_INTERCEPT_PKT_BIN"));
|
||||
if (entity.getFunctionId() == 200){
|
||||
Properties msgProp = getMsgProp();
|
||||
if(cfg.getAction().equals(1)) {
|
||||
cfg.setUserRegion5(msgProp.getProperty("intercept"));
|
||||
}else if(cfg.getAction().equals(48)) {
|
||||
cfg.setUserRegion5(msgProp.getProperty("action_spoofing"));
|
||||
}else if(cfg.getAction().equals(128)) {
|
||||
cfg.setUserRegion5(msgProp.getProperty("bypass"));
|
||||
}else {
|
||||
cfg.setUserRegion5(msgProp.getProperty(DictUtils.getDictLabels("SERVICE_ACTION", cfg.getAction().toString(), cfg.getAction().toString())));
|
||||
}
|
||||
}
|
||||
}
|
||||
pktBinList = BaseStringCfg.replaceBaseKeyList(pktBinList);
|
||||
httpUrlList = BaseStringCfg.baseHexList(httpUrlList);
|
||||
@@ -344,7 +356,7 @@ public class InterceptController extends CommonController {
|
||||
dataMap.put("PXY_INTERCEPT_IP", ipList);
|
||||
dataMap.put("PXY_INTERCEPT_PKT_BIN", pktBinList);
|
||||
} else if (entity.getFunctionId() == 200) {// IP拦截
|
||||
cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,userregion5,userregion2,&userregion1:intercept_file_strategy-";
|
||||
cfgIndexInfoNoExport = ",policy_name,group_name,userregion3,userregion4,block_type,&userregion1:intercept_file_strategy-userregion2:ratelimit-userregion5:block_type";
|
||||
titleList.add("PXY_INTERCEPT_IP");
|
||||
classMap.put("PXY_INTERCEPT_IP", IpPortCfg.class);
|
||||
noExportMap.put("PXY_INTERCEPT_IP", ipPortInfoNoExport);
|
||||
|
||||
@@ -420,7 +420,7 @@ public class PxyObjKeyringController extends BaseController {
|
||||
}
|
||||
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,";
|
||||
String cfgIndexInfoNoExport = ",config_describe,whether_area_block,block_type,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
@@ -485,7 +485,7 @@ public class PxyObjKeyringController extends BaseController {
|
||||
}
|
||||
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-";
|
||||
String cfgIndexInfoNoExport = ",whether_area_block,block_type,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,&config_describe:cert_name-";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
|
||||
@@ -525,7 +525,7 @@ public class TrafficStatisticsInfoController extends BaseController {
|
||||
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) - 12);
|
||||
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());
|
||||
List<WebsiteDomainTopic> domainList = appCfgService.getDomainDict(new WebsiteDomainTopic());// domain 域名
|
||||
model.addAttribute("domainList", domainList);
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
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.apache.commons.lang.StringEscapeUtils;
|
||||
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 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.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/mailRecord")
|
||||
public class MailRecordLogController extends BaseController {
|
||||
|
||||
@RequestMapping(value = { "list", "" })
|
||||
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()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getMailFrom())) {
|
||||
params.put("searchMailFrom", StringEscapeUtils.unescapeHtml(log.getMailFrom()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getSubject())) {
|
||||
params.put("searchSubject", StringEscapeUtils.unescapeHtml(log.getSubject()));
|
||||
}
|
||||
|
||||
params.put("searchCfgId", "0");// 邮件泛收 cfg_id=0
|
||||
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());
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
Page<NtcMailLog> data = fromJson.getData();
|
||||
page.setCount(data.getCount());
|
||||
page.setLast(data.getLast());
|
||||
page.setList(data.getList());
|
||||
List<NtcMailLog> list = page.getList();
|
||||
for (NtcMailLog l : list) {
|
||||
l.setFunctionId(log.getFunctionId());
|
||||
setLogAction(l, serviceList);
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("查询失败", e);
|
||||
addMessageLog(model, e.getMessage());
|
||||
}
|
||||
|
||||
return "/log/ntc/mailRecordList";
|
||||
}
|
||||
|
||||
// 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);
|
||||
|
||||
// 增加收/发件人、邮件主题查询
|
||||
if (StringUtils.isNotBlank(log.getMailTo())) {
|
||||
params.put("searchMailTo", StringEscapeUtils.unescapeHtml(log.getMailTo()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getMailFrom())) {
|
||||
params.put("searchMailFrom", StringEscapeUtils.unescapeHtml(log.getMailFrom()));
|
||||
}
|
||||
if (StringUtils.isNotBlank(log.getSubject())) {
|
||||
params.put("searchSubject", StringEscapeUtils.unescapeHtml(log.getSubject()));
|
||||
}
|
||||
|
||||
params.put("searchCfgId", "0");// 邮件泛收 cfg_id=0
|
||||
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_record");
|
||||
classMap.put("mail_record", NtcMailLog.class);
|
||||
SysUser user = UserUtils.getUser();
|
||||
if (!user.isAdmin()) {
|
||||
hColumns += ",scene_file,";
|
||||
} else {
|
||||
hColumns += ",";
|
||||
}
|
||||
String cfgIndexInfoNoExport = "," + hColumns;
|
||||
noExportMap.put("mail_record", cfgIndexInfoNoExport);
|
||||
dataMap.put("mail_record", list);
|
||||
String timeRange = initLogMap(log, "mail_record");
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
/* } */
|
||||
if ("csv".equals(type)) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, "mail_record", titleList, classMap,
|
||||
dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, "mail_record", titleList, classMap, dataMap,
|
||||
noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("mail_record export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,158 @@
|
||||
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.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.JsonSyntaxException;
|
||||
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.NtcSslRecordLog;
|
||||
import com.nis.domain.log.NtcSshLog;
|
||||
import com.nis.domain.log.NtcSslRecordLog;
|
||||
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("${adminPath}/log/ntc/sslRecord")
|
||||
@SuppressWarnings("all")
|
||||
public class SslRecordLogController extends BaseController {
|
||||
|
||||
@RequestMapping(value = { "list", "" })
|
||||
public String list(HttpServletRequest request, HttpServletResponse response, Model model,
|
||||
@ModelAttribute("log") NtcSslRecordLog NtcSslRecordLog) {
|
||||
|
||||
PageLog<NtcSslRecordLog> page = new PageLog<NtcSslRecordLog>(request, response);
|
||||
Map<String, Object> params = new HashMap<String, Object>();
|
||||
params.put("pageSize", page.getPageSize());
|
||||
params.put("pageNo", page.getPageNo());
|
||||
|
||||
// 请求参数判断
|
||||
initLogSearchValue(NtcSslRecordLog, params);
|
||||
if (StringUtils.isNotBlank(NtcSslRecordLog.getSni())) {
|
||||
params.put("SearchSni", NtcSslRecordLog.getSni());
|
||||
}
|
||||
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(NtcSslRecordLog.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
|
||||
try {
|
||||
// 请求接口
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_SSL_RECORD_LOG;
|
||||
String resJson = HttpClientUtil.getMsg(url, params, request);
|
||||
Gson gson = new GsonBuilder().create();
|
||||
LogRecvData<NtcSslRecordLog> fromJson = gson.fromJson(resJson,
|
||||
new TypeToken<LogRecvData<NtcSslRecordLog>>() {
|
||||
}.getType());
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
Page<NtcSslRecordLog> data = fromJson.getData();
|
||||
page.setCount(data.getCount());
|
||||
page.setLast(data.getLast());
|
||||
page.setList(data.getList());
|
||||
List<NtcSslRecordLog> list = page.getList();
|
||||
for (NtcSslRecordLog log : list) {
|
||||
log.setFunctionId(NtcSslRecordLog.getFunctionId());
|
||||
setLogAction(log, serviceList);
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("SSL泛收日志查询失败", e);
|
||||
addMessageLog(model, e.getMessage());
|
||||
}
|
||||
|
||||
return "/log/ntc/sslRecordLogList";
|
||||
}
|
||||
|
||||
// Ssl泛收配置导出
|
||||
@RequestMapping(value = "exportSsl")
|
||||
public void exportSsl(@ModelAttribute("log") NtcSslRecordLog 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<NtcSslRecordLog> page = new PageLog<NtcSslRecordLog>(request, response);
|
||||
List<NtcSslRecordLog> list = new ArrayList<NtcSslRecordLog>();
|
||||
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);
|
||||
if (StringUtils.isNotBlank(log.getSni())) {
|
||||
params.put("SearchSni", log.getSni());
|
||||
}
|
||||
|
||||
List<FunctionServiceDict> serviceList = DictUtils.getFunctionServiceDictList(log.getFunctionId());
|
||||
model.addAttribute("serviceList", serviceList);
|
||||
|
||||
String url = Constants.LOG_BASE_URL + Constants.NTC_SSL_RECORD_LOG;
|
||||
String recv = HttpClientUtil.getMsg(url, params, request);
|
||||
if (StringUtils.isNotBlank(recv)) {
|
||||
Gson gson = new GsonBuilder().create();
|
||||
LogRecvData<NtcSslRecordLog> fromJson = gson.fromJson(recv,
|
||||
new TypeToken<LogRecvData<NtcSslRecordLog>>() {
|
||||
}.getType());
|
||||
if (fromJson.getStatus().intValue() == 200) {
|
||||
Page<NtcSslRecordLog> data = fromJson.getData();
|
||||
list = data.getList();
|
||||
}
|
||||
}
|
||||
for (NtcSslRecordLog l : list) {
|
||||
l.setFunctionId(log.getFunctionId());
|
||||
setLogAction(l, serviceList);
|
||||
}
|
||||
titleList.add("ssl_record");
|
||||
classMap.put("ssl_record", NtcSslRecordLog.class);
|
||||
SysUser user = UserUtils.getUser();
|
||||
if (!user.isAdmin()) {
|
||||
hColumns += ",scene_file,";
|
||||
} else {
|
||||
hColumns += ",";
|
||||
}
|
||||
String cfgIndexInfoNoExport = "," + hColumns;
|
||||
noExportMap.put("ssl_record", cfgIndexInfoNoExport);
|
||||
dataMap.put("ssl_record", list);
|
||||
String timeRange = initLogMap(log, "ssl_record");
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
/* } */
|
||||
if ("csv".equals(type)) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, "ssl_record", titleList, classMap,
|
||||
dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, "ssl_record", titleList, classMap, dataMap,
|
||||
noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("ssl_record export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -395,7 +395,32 @@ public class NtcEventBlockController extends BaseController {
|
||||
list = data.getList();
|
||||
}
|
||||
}
|
||||
|
||||
//计算合计,并添加在集合的最后位置
|
||||
Properties msgProp = getMsgProp();
|
||||
NtcEventMonitorOrBlockReport ntcEventMonitorOrBlockReport = new NtcEventMonitorOrBlockReport();
|
||||
long ipNum = 0;
|
||||
long httpNum = 0;
|
||||
long mailNum = 0;
|
||||
long vedioNum = 0;
|
||||
long agentNum = 0;
|
||||
for (NtcEventMonitorOrBlockReport entity : list) {
|
||||
ipNum += entity.getIpNum();
|
||||
httpNum += entity.getHttpNum();
|
||||
mailNum += entity.getMailNum();
|
||||
vedioNum += entity.getVedioNum();
|
||||
agentNum += entity.getAgentNum();
|
||||
}
|
||||
String report_total = msgProp.getProperty("report_total");
|
||||
ntcEventMonitorOrBlockReport.setIpNum(ipNum);
|
||||
ntcEventMonitorOrBlockReport.setHttpNum(httpNum);
|
||||
ntcEventMonitorOrBlockReport.setMailNum(mailNum);
|
||||
ntcEventMonitorOrBlockReport.setVedioNum(vedioNum);
|
||||
ntcEventMonitorOrBlockReport.setAgentNum(agentNum);
|
||||
ntcEventMonitorOrBlockReport.setTaskIds(report_total);
|
||||
ntcEventMonitorOrBlockReport.setTaskName(" 一 ");
|
||||
ntcEventMonitorOrBlockReport.setTaskTime(" 一 ");
|
||||
ntcEventMonitorOrBlockReport.setReportTime(" 一 ");
|
||||
list.add(ntcEventMonitorOrBlockReport);
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
logger.error("ntc_event_block_report print failed", e);
|
||||
|
||||
@@ -386,6 +386,30 @@ public class NtcEventKeyProtectionController extends BaseController {
|
||||
list = data.getList();
|
||||
}
|
||||
}
|
||||
//计算合计,并填加到集合最后
|
||||
Properties msgProp = getMsgProp();
|
||||
NtcEventKeyProtectionReport ntcEventKey=new NtcEventKeyProtectionReport();
|
||||
long letterNum=0;
|
||||
long configNum=0;
|
||||
long monitorNum=0;
|
||||
long controlNum=0;
|
||||
for (NtcEventKeyProtectionReport entity : list) {
|
||||
letterNum += entity.getLetterNum();
|
||||
configNum += entity.getConfigNum();
|
||||
monitorNum += entity.getMonitorNum();
|
||||
controlNum += entity.getControlNum();
|
||||
}
|
||||
String report_total=msgProp.getProperty("report_total");
|
||||
ntcEventKey.setLetterNum(letterNum);
|
||||
ntcEventKey.setConfigNum(configNum);
|
||||
ntcEventKey.setMonitorNum(monitorNum);
|
||||
ntcEventKey.setControlNum(controlNum);
|
||||
ntcEventKey.setTaskIds(report_total);
|
||||
ntcEventKey.setTaskName(" 一 ");
|
||||
ntcEventKey.setTaskTime(" 一 ");
|
||||
ntcEventKey.setReportTime(" 一 ");
|
||||
list.add(ntcEventKey);
|
||||
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
logger.error("ntc_event_key_protection_report print failed", e);
|
||||
|
||||
@@ -393,6 +393,32 @@ public class NtcEventMonitorController extends BaseController {
|
||||
list = data.getList();
|
||||
}
|
||||
}
|
||||
//计算合计,并添加到集合的最后
|
||||
Properties msgProp = getMsgProp();
|
||||
NtcEventMonitorOrBlockReport ntcEventMonitorOrBlockReport = new NtcEventMonitorOrBlockReport();
|
||||
long ipNum = 0;
|
||||
long httpNum = 0;
|
||||
long mailNum = 0;
|
||||
long vedioNum = 0;
|
||||
long agentNum = 0;
|
||||
for (NtcEventMonitorOrBlockReport entity : list) {
|
||||
ipNum += entity.getIpNum();
|
||||
httpNum += entity.getHttpNum();
|
||||
mailNum += entity.getMailNum();
|
||||
vedioNum += entity.getVedioNum();
|
||||
agentNum += entity.getAgentNum();
|
||||
}
|
||||
String report_total = msgProp.getProperty("report_total");
|
||||
ntcEventMonitorOrBlockReport.setIpNum(ipNum);
|
||||
ntcEventMonitorOrBlockReport.setHttpNum(httpNum);
|
||||
ntcEventMonitorOrBlockReport.setMailNum(mailNum);
|
||||
ntcEventMonitorOrBlockReport.setVedioNum(vedioNum);
|
||||
ntcEventMonitorOrBlockReport.setAgentNum(agentNum);
|
||||
ntcEventMonitorOrBlockReport.setTaskIds(report_total);
|
||||
ntcEventMonitorOrBlockReport.setTaskName(" 一 ");
|
||||
ntcEventMonitorOrBlockReport.setTaskTime(" 一 ");
|
||||
ntcEventMonitorOrBlockReport.setReportTime(" 一 ");
|
||||
list.add(ntcEventMonitorOrBlockReport);
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
logger.error("ntc_event_monitor_report print failed", e);
|
||||
|
||||
@@ -613,6 +613,23 @@ public class ReportController extends BaseController {
|
||||
list = data.getList();
|
||||
}
|
||||
}
|
||||
Properties msgProp = getMsgProp();
|
||||
NtcAsnRecord ntcAsnRecord = new NtcAsnRecord();
|
||||
double pps = 0;
|
||||
double bps = 0;
|
||||
for (NtcAsnRecord entity : list) {
|
||||
if (null != entity.getBps() && !"".equals(entity.getBps())) {
|
||||
bps += Double.valueOf(entity.getBps());
|
||||
}
|
||||
if (null != entity.getPps() && !"".equals(entity.getPps())) {
|
||||
pps += Double.valueOf(entity.getPps());
|
||||
}
|
||||
}
|
||||
String report_total = msgProp.getProperty("report_total");
|
||||
ntcAsnRecord.setAsn(report_total);
|
||||
ntcAsnRecord.setBps(String.format("%.2f", bps));
|
||||
ntcAsnRecord.setPps(String.format("%.2f", pps));
|
||||
list.add(ntcAsnRecord);
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
logger.error("Ntc_Asn_Record print failed", e);
|
||||
@@ -664,6 +681,19 @@ public class ReportController extends BaseController {
|
||||
list = data.getList();
|
||||
}
|
||||
}
|
||||
Properties msgProp = getMsgProp();
|
||||
NtcURLReport ntcURLReport = new NtcURLReport();
|
||||
long ipCount=0;
|
||||
long connCount=0;
|
||||
for (NtcURLReport entity : list) {
|
||||
ipCount += entity.getIpCount();
|
||||
connCount += entity.getConnCount();
|
||||
}
|
||||
String report_total = msgProp.getProperty("report_total");
|
||||
ntcURLReport.setIpCount(ipCount);
|
||||
ntcURLReport.setConnCount(connCount);
|
||||
ntcURLReport.setUrl(report_total);
|
||||
list.add(ntcURLReport);
|
||||
return list;
|
||||
} catch (Exception e) {
|
||||
logger.error("Ntc_HTTPS_Report print failed", e);
|
||||
|
||||
Reference in New Issue
Block a user