diff --git a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java index aaf5f874c..41a9e9444 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java @@ -346,6 +346,7 @@ public class AppCfgController extends BaseController { public String ipCfgForm(Model model, String ids, AppIpCfg entity) { if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppIpCfg(Long.parseLong(ids)); + entity.setAppFeaturePropCfgList(appMultiFeatureCfgService.getAppFeaturePropCfg(entity.getCompileId(), entity.getFunctionId(), null)); initUpdateFormCondition(model, entity); } else { initFormCondition(model, entity); @@ -671,6 +672,7 @@ public class AppCfgController extends BaseController { public String domainCfgForm(Model model, String ids, AppDomainCfg entity) { if (StringUtils.isNotBlank(ids)) { entity = appCfgService.getAppDomainCfg(Long.parseLong(ids)); + entity.setAppFeaturePropCfgList(appMultiFeatureCfgService.getAppFeaturePropCfg(entity.getCompileId(), entity.getFunctionId(), null)); initUpdateFormCondition(model, entity); } else { initFormCondition(model, entity); diff --git a/src/main/java/com/nis/web/service/configuration/AppCfgService.java b/src/main/java/com/nis/web/service/configuration/AppCfgService.java index c21c31204..868cc403d 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -493,11 +493,19 @@ public class AppCfgService extends BaseService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + // 保存 控管参数和特征属性组件信息 + if(entity.getAppFeaturePropCfgList()!=null){ + for(AppFeatureProperties cfg:entity.getAppFeaturePropCfgList()){ + BeanUtils.copyProperties(entity, cfg); + appMultiFeatureCfgDao.insertAppFeaturePropCfg(cfg); + } + } } else { entity.setEditorId(entity.getCurrentUser().getId()); entity.setEditTime(new Date()); entity.setIsValid(0); entity.setIsAudit(0); + appMultiFeatureCfgDao.deleteAppFeaturePropCfg(entity); appCfgDao.updateAppIpCfg(entity); // 删除旧的区域IP,新增新的区域IP AreaIpCfg area = new AreaIpCfg(); @@ -517,6 +525,13 @@ public class AppCfgService extends BaseService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + // 更新 控管参数和特征属性组件信息 + if(entity.getAppFeaturePropCfgList()!=null){ + for(AppFeatureProperties cfg:entity.getAppFeaturePropCfgList()){ + BeanUtils.copyProperties(entity, cfg); + appMultiFeatureCfgDao.insertAppFeaturePropCfg(cfg); + } + } } } public void saveAppHttpCfg(List cfgs) { @@ -620,6 +635,13 @@ public class AppCfgService extends BaseService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + // 保存 控管参数和特征属性组件信息 + if(entity.getAppFeaturePropCfgList()!=null){ + for(AppFeatureProperties cfg:entity.getAppFeaturePropCfgList()){ + BeanUtils.copyProperties(entity, cfg); + appMultiFeatureCfgDao.insertAppFeaturePropCfg(cfg); + } + } } catch (Exception e) { e.printStackTrace(); logger.info("获取编译ID出错"); @@ -630,6 +652,7 @@ public class AppCfgService extends BaseService { entity.setEditTime(new Date()); entity.setIsValid(0); entity.setIsAudit(0); + appMultiFeatureCfgDao.deleteAppFeaturePropCfg(entity); appCfgDao.updateAppDomainCfg(entity); // 删除旧的区域IP,新增新的区域IP AreaIpCfg area = new AreaIpCfg(); @@ -646,6 +669,13 @@ public class AppCfgService extends BaseService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + // 更新 控管参数和特征属性组件信息 + if(entity.getAppFeaturePropCfgList()!=null){ + for(AppFeatureProperties cfg:entity.getAppFeaturePropCfgList()){ + BeanUtils.copyProperties(entity, cfg); + appMultiFeatureCfgDao.insertAppFeaturePropCfg(cfg); + } + } } } @@ -1268,6 +1298,43 @@ public class AppCfgService extends BaseService { specificServiceCfg.setOpTime(new Date()); specificServiceCfgDao.update(specificServiceCfg); } + + List appFeaturePropCfgList = appMultiFeatureCfgDao.getAppFeaturePropCfg(entitys.get(0).getCompileId(), entitys.get(0).getFunctionId(), null); + String featureUserRegion = ""; + if(!StringUtil.isEmpty(appFeaturePropCfgList)){ + AppFeatureProperties cfg = appFeaturePropCfgList.get(0); + // 处理下发userRegion + if(!StringUtil.isEmpty(cfg.getDropOpt())){ + featureUserRegion += "DKC=10;DKS="+cfg.getDropOpt()+";"; + } + if(!StringUtil.isEmpty(cfg.getLoopOpt())){ + featureUserRegion += "DKC=4;DKS="+cfg.getLoopOpt()+";"; + } + if(!StringUtil.isEmpty(cfg.getExtendScanPktNum())){ + featureUserRegion += "DKC=7;DKS="+cfg.getExtendScanPktNum()+";"; + } + if(!StringUtil.isEmpty(cfg.getLongStreamLockTime())){ + featureUserRegion += "DKC=16;DKS="+cfg.getLongStreamLockTime()+";"; + } + if(!StringUtil.isEmpty(cfg.getCorrelationValidTime())){ + featureUserRegion += "DKC=3;DKS="+cfg.getCorrelationValidTime()+";"; + } + + if(!StringUtil.isEmpty(cfg.getWeakFeature())){ + featureUserRegion += cfg.getWeakFeature(); + } + if(!StringUtil.isEmpty(cfg.getWhitelistFeature())){ + featureUserRegion += cfg.getWhitelistFeature(); + } + if(!StringUtil.isEmpty(cfg.getCorrelationBlockAfter())){ + featureUserRegion += cfg.getCorrelationBlockAfter(); + } + AppFeatureProperties appFeatureProp = new AppFeatureProperties(); + BeanUtils.copyProperties(entitys.get(0), appFeatureProp, new String[] { "cfgId" }); + appFeatureProp.setTableName(AppFeatureProperties.getTablename()); + appCfgDao.auditCfg(appFeatureProp); + } + Integer groupId=configGroupInfo.getGroupId(); // 构造提交综合服务参数格式,一条配置提交一次综合服务 if (isAudit == 1) { @@ -1296,7 +1363,9 @@ public class AppCfgService extends BaseService { maatCfg.setIsValid(entitys.get(0).getIsValid()); // 设置APP自定义域 String userRegion = "APP_ID=" + entitys.get(0).getAppCode()/*+Constants.USER_REGION_SPLIT+"ASEV_ID="+businessType*/; - maatCfg.setUserRegion(userRegion); + if(!StringUtil.isEmpty(featureUserRegion)){ + maatCfg.setUserRegion(userRegion + ";" +featureUserRegion); + } configCompileList.add(maatCfg); maatBean.setConfigCompileList(configCompileList); maatBean.setAuditTime(entitys.get(0).getAuditTime()); @@ -1504,6 +1573,42 @@ public class AppCfgService extends BaseService { areaIpRegionList = map.get("dstList"); } } + List appFeaturePropCfgList = appMultiFeatureCfgDao.getAppFeaturePropCfg(entity.getCompileId(), entity.getFunctionId(), null); + String featureUserRegion = ""; + if(!StringUtil.isEmpty(appFeaturePropCfgList)){ + AppFeatureProperties cfg = appFeaturePropCfgList.get(0); + // 处理下发userRegion + if(!StringUtil.isEmpty(cfg.getDropOpt())){ + featureUserRegion += "DKC=10;DKS="+cfg.getDropOpt()+";"; + } + if(!StringUtil.isEmpty(cfg.getLoopOpt())){ + featureUserRegion += "DKC=4;DKS="+cfg.getLoopOpt()+";"; + } + if(!StringUtil.isEmpty(cfg.getExtendScanPktNum())){ + featureUserRegion += "DKC=7;DKS="+cfg.getExtendScanPktNum()+";"; + } + if(!StringUtil.isEmpty(cfg.getLongStreamLockTime())){ + featureUserRegion += "DKC=16;DKS="+cfg.getLongStreamLockTime()+";"; + } + if(!StringUtil.isEmpty(cfg.getCorrelationValidTime())){ + featureUserRegion += "DKC=3;DKS="+cfg.getCorrelationValidTime()+";"; + } + + if(!StringUtil.isEmpty(cfg.getWeakFeature())){ + featureUserRegion += cfg.getWeakFeature(); + } + if(!StringUtil.isEmpty(cfg.getWhitelistFeature())){ + featureUserRegion += cfg.getWhitelistFeature(); + } + if(!StringUtil.isEmpty(cfg.getCorrelationBlockAfter())){ + featureUserRegion += cfg.getCorrelationBlockAfter(); + } + AppFeatureProperties appFeatureProp = new AppFeatureProperties(); + BeanUtils.copyProperties(entity, appFeatureProp, new String[] { "cfgId" }); + appFeatureProp.setTableName(AppFeatureProperties.getTablename()); + appCfgDao.auditCfg(appFeatureProp); + } + // 构造提交综合服务参数格式,一条配置提交一次综合服务 if (isAudit == 1) { maatCfg.initDefaultValue(); @@ -1525,8 +1630,9 @@ public class AppCfgService extends BaseService { if(!StringUtil.isEmpty(entity.getUserRegion5())){ userRegion+=";"+Constants.INTERCEPT_DOMAN_INTENSITY_USER_REGION_KEY+"="+entity.getUserRegion5(); } - - maatCfg.setUserRegion(userRegion); + if(!StringUtil.isEmpty(featureUserRegion)) { + maatCfg.setUserRegion(userRegion + ";" +featureUserRegion); + } configCompileList.add(maatCfg); maatBean.setConfigCompileList(configCompileList); maatBean.setAuditTime(entity.getAuditTime()); @@ -1875,6 +1981,13 @@ public class AppCfgService extends BaseService { cfg.setTableName(AreaIpCfg.getTablename()); appCfgDao.updateCfgValid(cfg); } + //修改特征属性配置表状态 + if (!StringUtil.isEmpty(entity.getAppFeaturePropCfgList())) { + AppFeatureProperties cfg = new AppFeatureProperties(); + BeanUtils.copyProperties(entity, cfg, new String[] { "cfgId" }); + cfg.setTableName(AppFeatureProperties.getTablename()); + appMultiFeatureCfgDao.updateCfgValid(cfg); + } } @@ -1944,6 +2057,13 @@ public class AppCfgService extends BaseService { cfg.setTableName(AreaIpCfg.getTablename()); appCfgDao.updateCfgValid(cfg); } + //修改特征属性配置表状态 + if (!StringUtil.isEmpty(entity.getAppFeaturePropCfgList())) { + AppFeatureProperties cfg = new AppFeatureProperties(); + BeanUtils.copyProperties(entity, cfg, new String[] { "cfgId" }); + cfg.setTableName(AppFeatureProperties.getTablename()); + appMultiFeatureCfgDao.updateCfgValid(cfg); + } } diff --git a/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java b/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java index 86a76a38b..d6037d8f1 100644 --- a/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppMultiFeatureCfgService.java @@ -657,7 +657,10 @@ public class AppMultiFeatureCfgService extends BaseService { if(!StringUtil.isEmpty(cfg.getCorrelationBlockAfter())){ featureUserRegion += cfg.getCorrelationBlockAfter(); } - + AppFeatureProperties appFeatureProp = new AppFeatureProperties(); + BeanUtils.copyProperties(entity, appFeatureProp, new String[] { "cfgId" }); + appFeatureProp.setTableName(AppFeatureProperties.getTablename()); + appMultiFeatureCfgDao.auditCfg(appFeatureProp); } // 构造提交综合服务参数格式,一条配置提交一次综合服务 diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appCorrelationFeatureCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appCorrelationFeatureCfgForm.jsp index d1b674d34..cae363855 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appCorrelationFeatureCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appCorrelationFeatureCfgForm.jsp @@ -264,7 +264,6 @@ var delContent = function(contentClassName, addBtnClassName) { -