diff --git a/src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml index ec33f8ff0..cf1943c4e 100644 --- a/src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/WebsiteCfgDao.xml @@ -134,7 +134,7 @@ a.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY, a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,a.dns_strategy_id,a.user_region1, a.user_region2,a.user_region3,a.user_region4,a.user_region5,a.do_log,a.source_compile_id,a.cancel_request_id, - a.do_blacklist + a.do_blacklist,a.common_group_ids a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port @@ -490,7 +490,8 @@ user_region5, do_log, source_compile_id, - do_blacklist + do_blacklist, + common_group_ids )values ( #{cfgDesc,jdbcType=VARCHAR}, #{action,jdbcType=INTEGER}, @@ -519,7 +520,8 @@ #{userRegion5,jdbcType=VARCHAR}, #{doLog,jdbcType=INTEGER}, #{sourceCompileId,jdbcType=INTEGER}, - #{doBlackList,jdbcType=INTEGER} + #{doBlackList,jdbcType=INTEGER}, + #{commonGroupIds,jdbcType=VARCHAR} ) @@ -948,6 +950,9 @@ user_region4 = #{userRegion4,jdbcType=VARCHAR}, user_region5 = #{userRegion5,jdbcType=VARCHAR}, dns_strategy_id = #{dnsStrategyId,jdbcType=INTEGER}, + + common_group_ids = #{commonGroupIds,jdbcType=VARCHAR} + where cfg_id = #{cfgId,jdbcType=BIGINT} diff --git a/src/main/java/com/nis/web/service/BaseService.java b/src/main/java/com/nis/web/service/BaseService.java index 9e1f5b934..1b13fe6b8 100644 --- a/src/main/java/com/nis/web/service/BaseService.java +++ b/src/main/java/com/nis/web/service/BaseService.java @@ -3507,6 +3507,33 @@ public abstract class BaseService { } } } - + /** + * 关键字公共组配置处理 + * @param entity + */ + public void auditStrGroupCfg(List groupRelationList,BaseCfg entity){ + // url,跟dns公共组下发时用的组id + if(entity!=null&&!StringUtil.isEmpty(entity.getCommonGroupIds())){ + // maat添加公共组信息 + String[] orgGroupIds=entity.getCommonGroupIds().split(","); + for (int i = 0; i < orgGroupIds.length; i++) { + if(!StringUtil.isEmpty(orgGroupIds[i])){ + List listGroupId=new ArrayList<>(); + GroupCfg group = new GroupCfg(); + group.setGroupId(Integer.parseInt(orgGroupIds[i])); + group.setCompileId(entity.getCompileId()); + group.setAuditTime(entity.getAuditTime()); + group.setIsValid(entity.getIsValid()); // '0无效,1有效,-1删除; + group.setIsCommonGroup(1); // 标识为公共组 ,已下发过的组是否还需标记为公共组 + if(!listGroupId.contains(group.getGroupId())){ + groupRelationList.add(group); + listGroupId.add(group.getGroupId()); + } + } + } + } + + } + } diff --git a/src/main/java/com/nis/web/service/configuration/DomainService.java b/src/main/java/com/nis/web/service/configuration/DomainService.java index 854f00f05..1e42045a9 100644 --- a/src/main/java/com/nis/web/service/configuration/DomainService.java +++ b/src/main/java/com/nis/web/service/configuration/DomainService.java @@ -577,7 +577,6 @@ public class DomainService extends CrudService { //查询子配置并修改审核状态 entity = this.getDomainCfg(entity.getCfgId(),entity.getCompileId()); - if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){ HttpUrlCfg cfg = new HttpUrlCfg(); BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); @@ -616,6 +615,7 @@ public class DomainService extends CrudService { //构造提交综合服务参数格式,一条配置提交一次综合服务 if(isAudit==1){ + auditStrGroupCfg(groupRelationList, entity); // 是否添加公共组 maatCfg.initDefaultValue(); BeanUtils.copyProperties(entity, maatCfg); maatCfg.setAction(entity.getAction()); @@ -643,6 +643,7 @@ public class DomainService extends CrudService { logger.info("domain配置下发响应信息:"+result.getMsg()); }else if(isAudit==3){ + addKeepGroupList(maatCfg, entity);// 取消审核保留公共组 maatCfg.setCompileId(entity.getCompileId()); maatCfg.setServiceId(entity.getServiceId()); maatCfg.setIsValid(0);//无效 diff --git a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java index edab676ee..0732d1f74 100644 --- a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java @@ -1195,6 +1195,7 @@ public class WebsiteCfgService extends CrudService { //构造提交综合服务参数格式,一条配置提交一次综合服务 if(isAudit==1){ + auditStrGroupCfg(groupRelationList, entity); // 是否添加公共组 maatCfg.initDefaultValue(); BeanUtils.copyProperties(entity, maatCfg); maatCfg.setAction(entity.getAction()); @@ -1226,6 +1227,7 @@ public class WebsiteCfgService extends CrudService { logger.info("dns配置下发响应信息:"+result.getMsg()); }else if(isAudit==3){ + addKeepGroupList(maatCfg, entity);// 取消审核保留公共组 maatCfg.setCompileId(entity.getCompileId()); maatCfg.setServiceId(entity.getServiceId()); maatCfg.setIsValid(0);//无效 diff --git a/src/main/webapp/WEB-INF/views/cfg/dnsGroupForm.jsp b/src/main/webapp/WEB-INF/views/cfg/dnsGroupForm.jsp index 27130a2fd..231bd9c0c 100644 --- a/src/main/webapp/WEB-INF/views/cfg/dnsGroupForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/dnsGroupForm.jsp @@ -53,7 +53,7 @@ diff --git a/src/main/webapp/WEB-INF/views/cfg/urlGroupForm.jsp b/src/main/webapp/WEB-INF/views/cfg/urlGroupForm.jsp index 59336cfe1..488f27437 100644 --- a/src/main/webapp/WEB-INF/views/cfg/urlGroupForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/urlGroupForm.jsp @@ -53,7 +53,7 @@ diff --git a/src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp b/src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp index e434addd7..37048d1c4 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/dnsForm.jsp @@ -13,6 +13,10 @@ $(document) .ready( function() { + // 修改dns公共组时回显用 + if($("select[name$='commonGroupIds']").val()){ + addContent($(".dnsGroupAdd"),'dnsGroup'); + } $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); diff --git a/src/main/webapp/WEB-INF/views/cfg/website/dnsSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/dnsSubList.jsp index 964e0604f..65f5adb7b 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/dnsSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/dnsSubList.jsp @@ -25,6 +25,13 @@ + +
+ + +
+
@@ -350,4 +357,19 @@ <%@include file="/WEB-INF/include/form/scheduleNewSubList.jsp"%> + + +
+
+
+
+<%-- --%> + +
+
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/domainForm.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/domainForm.jsp index f58473dd9..073d252fc 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/domainForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/domainForm.jsp @@ -13,6 +13,11 @@ $(document) .ready( function() { + // 修改url公共组时回显用 + if($("select[name$='commonGroupIds']").val()){ + addContent($(".urlGroupAdd"),'urlGroup'); + } + $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/domianSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/domianSubList.jsp index 3fbe6cfa4..511008bca 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/domianSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/domianSubList.jsp @@ -25,6 +25,13 @@ + +
+ + +
+
@@ -345,4 +352,19 @@ <%@include file="/WEB-INF/include/form/scheduleNewSubList.jsp"%> + + +
+
+
+
+<%-- --%> + +
+
+
+
+
\ No newline at end of file