diff --git a/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java b/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java index 01235948e..38ac364d0 100644 --- a/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java +++ b/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java @@ -36,7 +36,11 @@ public class AppPolicyCfg extends BaseCfg { private Integer specServiceId; private String appName; private String cfgKeywords; - + private String userRegion1; + private String userRegion2; + private String userRegion3; + private String userRegion4; + private String userRegion5; @Expose @ExcelField(title="expression_type") @SerializedName("exprType") @@ -155,5 +159,45 @@ public class AppPolicyCfg extends BaseCfg { public void setIpPort(IpPortCfg ipPort) { this.ipPort = ipPort; } + + public String getUserRegion1() { + return userRegion1; + } + + public void setUserRegion1(String userRegion1) { + this.userRegion1 = userRegion1; + } + + public String getUserRegion2() { + return userRegion2; + } + + public void setUserRegion2(String userRegion2) { + this.userRegion2 = userRegion2; + } + + public String getUserRegion3() { + return userRegion3; + } + + public void setUserRegion3(String userRegion3) { + this.userRegion3 = userRegion3; + } + + public String getUserRegion4() { + return userRegion4; + } + + public void setUserRegion4(String userRegion4) { + this.userRegion4 = userRegion4; + } + + public String getUserRegion5() { + return userRegion5; + } + + public void setUserRegion5(String userRegion5) { + this.userRegion5 = userRegion5; + } } diff --git a/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java b/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java index fcc2e9811..40b187746 100644 --- a/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java +++ b/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java @@ -25,11 +25,17 @@ public class SpecificServiceCfg extends BaseEntity{ private SpecificServiceCfg parent; //parent_id 父节点id int N 0表示一级节点 private Integer isLeaf; //is_leaf 是否是叶子节点 int N 0否,1是,只有一级填0 private Integer groupId; //group_id maat端配置分组id int N 缺省0,表示未与maat分组同步 + private Integer cfgType;//配置类型,1,app;2,加密隧道协议 private Date beginDate; // 开始日期 private Date endDate; // 结束日期 private String showSequence; //显示序号 - + public Integer getCfgType() { + return cfgType; + } + public void setCfgType(Integer cfgType) { + this.cfgType = cfgType; + } public Integer getSpecServiceId() { return specServiceId; } 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 c5428af83..498aa7618 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java @@ -16,14 +16,11 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; -import com.nis.domain.ServiceConfigInfo; import com.nis.domain.configuration.AppByteCfg; import com.nis.domain.configuration.AppDomainCfg; import com.nis.domain.configuration.AppHttpCfg; import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppPolicyCfg; -import com.nis.domain.configuration.BaseStringCfg; -import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.specific.SpecificServiceCfg; import com.nis.exceptions.MaatConvertException; diff --git a/src/main/java/com/nis/web/controller/specific/SpecificServiceCfgController.java b/src/main/java/com/nis/web/controller/specific/SpecificServiceCfgController.java index ed725f25a..d0c9b1c45 100644 --- a/src/main/java/com/nis/web/controller/specific/SpecificServiceCfgController.java +++ b/src/main/java/com/nis/web/controller/specific/SpecificServiceCfgController.java @@ -190,7 +190,7 @@ public class SpecificServiceCfgController extends BaseController { @ResponseBody @RequestMapping(value = "treeData") public List> treeData(@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide, - @RequestParam(required=false)boolean isLeafShow,HttpServletResponse response){ + @RequestParam(required=false)boolean isLeafShow,@RequestParam(required=true)Integer cfgType,HttpServletResponse response){ List> mapList = Lists.newArrayList(); Map map2 = Maps.newHashMap(); map2.put("id", 0); @@ -203,7 +203,7 @@ public class SpecificServiceCfgController extends BaseController { SpecificServiceCfg specificServiceCfg = list.get(i); if(StringUtils.isBlank(extId)||(extId!=null&&!extId.equals(specificServiceCfg.getSpecServiceId().toString()))){ if(specificServiceCfg.getIsValid().equals(0)|| - (!isLeafShow && specificServiceCfg.getIsLeaf().equals(1))){ + (!isLeafShow && specificServiceCfg.getIsLeaf().equals(1))||specificServiceCfg.getCfgType().intValue()!=cfgType){ continue; } Map map = Maps.newHashMap(); @@ -215,7 +215,26 @@ public class SpecificServiceCfgController extends BaseController { } return mapList; } - + /** + * + */ + @ResponseBody + @RequestMapping(value = "childrenList") + public List> childrenList(@RequestParam(required=false)Integer parent,HttpServletResponse response){ + List> mapList = Lists.newArrayList(); + List list = specificServiceCfgService.getChildrenById(parent); + for (int i=0; i map = Maps.newHashMap(); + SpecificServiceCfg specificServiceCfg = list.get(i); + if(specificServiceCfg.getIsLeaf().equals(1)){ + map.put("code", specificServiceCfg.getSpecServiceCode()); + map.put("pId", specificServiceCfg.getParent().getSpecServiceId()); + map.put("name",specificServiceCfg.getSpecServiceName()); + mapList.add(map); + } + } + return mapList; + } /** * 校验协议id是否重复 * @param specServiceId diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml index f5f63912b..a2ace008d 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml @@ -29,6 +29,11 @@ + + + + + @@ -229,7 +234,8 @@ r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME, r.SERVICE_ID,r.REQUEST_ID,r.COMPILE_ID,r.IS_AREA_EFFECTIVE,r.CLASSIFY, r.ATTRIBUTE,r.LABLE,r.AREA_EFFECTIVE_IDS,r.RATELIMIT,r.FUNCTION_ID, - r.CFG_TYPE,r.CFG_REGION_CODE,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN + r.CFG_TYPE,r.CFG_REGION_CODE,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.USER_REGION1,r.USER_REGION2, + r.USER_REGION3,r.USER_REGION4,r.USER_REGION5 @@ -440,6 +446,21 @@ AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%') + + + AND r.user_region1 =#{userRegion1,jdbcType=VARCHAR} + + + AND r.user_region2 =#{userRegion2,jdbcType=VARCHAR} + + + AND r.user_region3 =#{userRegion3,jdbcType=VARCHAR} + + + AND r.user_region4 =#{userRegion4,jdbcType=VARCHAR} + + + AND r.user_region5 =#{userRegion5,jdbcType=VARCHAR} AND r.compile_id in (select t.compile_id from ip_port_cfg t @@ -991,10 +1012,13 @@ CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY, ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS,RATELIMIT,FUNCTION_ID, - CFG_TYPE,CFG_REGION_CODE,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN + CFG_TYPE,CFG_REGION_CODE,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,USER_REGION1 + ,USER_REGION2,USER_REGION3,USER_REGION4,USER_REGION5 )values ( , #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER} + ,#{userRegion1,jdbcType=VARCHAR} ,#{userRegion2,jdbcType=VARCHAR} ,#{userRegion3,jdbcType=VARCHAR} + ,#{userRegion4,jdbcType=VARCHAR} ,#{userRegion5,jdbcType=VARCHAR} ) @@ -1230,6 +1254,21 @@ CFG_TYPE =#{cfgType,jdbcType=VARCHAR}, + + + USER_REGION1 =#{userRegion1,jdbcType=VARCHAR}, + + + USER_REGION2 =#{userRegion2,jdbcType=VARCHAR}, + + + USER_REGION1 =#{userRegion3,jdbcType=VARCHAR}, + + + USER_REGION1 =#{userRegion4,jdbcType=VARCHAR}, + + + USER_REGION1 =#{userRegion5,jdbcType=VARCHAR}, diff --git a/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml index c62e0b229..4ba609c2c 100644 --- a/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml +++ b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml @@ -11,6 +11,7 @@ + @@ -26,7 +27,8 @@ s.op_time AS opTime, s.parent_id AS "parent.specServiceId", s.is_leaf AS isLeaf, - s.group_id AS groupId + s.group_id AS groupId, + s.cfg_type AS cfgType @@ -53,6 +55,9 @@ AND group_id like '%${groupId}%' + + AND cfg_type =#{cfgType,jdbcType=INTEGER} + AND s.op_time >= #{beginDate,jdbcType=TIMESTAMP} @@ -112,6 +117,9 @@ AND group_id like '%${specificServiceCfg.groupId}%' + + AND cfg_type = #{specificServiceCfg.cfgType} + AND op_time > #{specificServiceCfg.beginDate} @@ -130,8 +138,8 @@ - insert into specific_service_cfg (spec_service_code,spec_service_name,spec_service_desc,is_valid, op_time, parent_id,is_leaf,group_id) - values(#{specServiceCode},#{specServiceName},#{specServiceDesc},#{isValid},#{opTime},#{parent.specServiceId},#{isLeaf},#{groupId}) + insert into specific_service_cfg (spec_service_code,spec_service_name,spec_service_desc,is_valid, op_time, parent_id,is_leaf,group_id,cfg_type) + values(#{specServiceCode},#{specServiceName},#{specServiceDesc},#{isValid},#{opTime},#{parent.specServiceId},#{isLeaf},#{groupId},#{cfgType}) @@ -144,7 +152,8 @@ s.op_time = #{opTime}, s.parent_id = #{parent.specServiceId}, s.is_leaf = #{isLeaf}, - s.group_id = #{groupId} + s.group_id = #{groupId}, + s.cfg_type = #{cfgType} WHERE s.spec_service_id = #{specServiceId} diff --git a/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java b/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java index f42ed13fb..6c1e0c5fa 100644 --- a/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java +++ b/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java @@ -86,6 +86,19 @@ public class ServiceDictInfoService extends BaseService{ } return list; } + /** + * 查询该类型所有的非叶子配置 + */ + public List findAllNoLeafDictList(String itType,Integer cfgType) { + List list = Lists.newArrayList(); + List intArr = ConfigDictUtils.dealTypeCondition(Configurations.getStringProperty("SERVICE_DICT_ITM_TYPE", ""), itType); + + for(Integer intType:intArr){ + List tempList = serviceDictInfoDao.findAllNoLeafDictList(intType); + list.addAll(tempList); + } + return list; + } /** * 根据主键查询字典详细信息 * @param serviceDictId diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index a7d5faa4c..6fe82cc33 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -790,6 +790,9 @@ app_byte_config=APP Byte Feature social_app=Applicaiton app_policy_config=APP Policy app_features_config=APP Feature +cfg_type=Cfg Type +encrypted_tunnel_protpcol=Encrypted Tunnel Protpcol +behaviour_type=Behaviour Type #=============about app config=========== #=============about Maintenance========= ip_Reuse_pool_config=IP Reuseing Pool diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index fc408eef6..7c4ce27d8 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -702,6 +702,20 @@ ratelimit=ratelimit scale ir_type=multiplex type dns_strategy_id=dns strategy id #=============about manipulation========= +#=============about app config=========== +domain=Domain +app_ip_config=APP Protocol IP +bytes=byte +app_http_config=APP HTTP Feature +app_domain_config=APP Domain Feature +app_byte_config=APP Byte Feature +social_app=Applicaiton +app_policy_config=APP Policy +app_features_config=APP Feature +cfg_type=Cfg Type +encrypted_tunnel_protpcol=Encrypted Tunnel Protpcol +behaviour_type=Behaviour Type +#=============about app config=========== #=============about Maintenance========= ip_multiplex_pool_config=ip multiplex pool config dns_res_strategy=dns response strategy diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index 44b006689..54626da72 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -792,6 +792,9 @@ app_byte_config=APP\u5B57\u8282\u7279\u5F81 social_app=\u793E\u4EA4\u5E94\u7528 app_policy_config=APP\u7B56\u7565 app_features_config=APP\u7279\u5F81 +cfg_type=\u914D\u7F6E\u7C7B\u578B +encrypted_tunnel_protpcol=\u52A0\u5BC6\u96A7\u9053\u534F\u8BAE +behaviour_type=\u884C\u4E3A\u7C7B\u578B #=============about app config=========== #=============about Maintenance========= ip_multiplex_pool_config=IP\u590D\u7528\u5730\u5740\u6C60 diff --git a/src/main/webapp/WEB-INF/tags/sys/treeselect.tag b/src/main/webapp/WEB-INF/tags/sys/treeselect.tag index e4c10942a..a59988eea 100644 --- a/src/main/webapp/WEB-INF/tags/sys/treeselect.tag +++ b/src/main/webapp/WEB-INF/tags/sys/treeselect.tag @@ -107,10 +107,12 @@ break; // 如果为非复选框选择,则返回第一个选择 } $("#${id}Id").val(ids.join(",").replace(/u_/ig,"")); + $("#${id}Id").change();//手动触发change事件,使Id的值得变化可以被监听到 $("#${id}Name").val(names.join(",")); }// else if (v=="clear"){ $("#${id}Id").val(""); + $("#${id}Id").change();//手动触发change事件,使Id的值得变化可以被监听到 $("#${id}Name").val(""); }// if(typeof ${id}TreeselectCallBack == 'function'){ diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp index 442549211..c41709564 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp @@ -46,6 +46,9 @@ $(function(){
+ + +

@@ -88,7 +91,7 @@ $(function(){

diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp index 85262ef3a..8e979c3ff 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp @@ -47,6 +47,9 @@ $(function(){
+ + +

@@ -88,7 +91,7 @@ $(function(){

diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp index 21d592d47..67924e142 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp @@ -47,6 +47,9 @@ $(function(){
+ + +

@@ -88,7 +91,7 @@ $(function(){

diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp index 088670e10..4fc2d3e96 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp @@ -29,6 +29,9 @@ $(function(){
+ + +

@@ -69,7 +72,7 @@ $(function(){
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp index 6af343023..99e926114 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgForm.jsp @@ -57,7 +57,57 @@ $(function(){ }, errorContainer: "#messageBox", }); + if('${_cfg.userRegion1}'){ + ajaxBehaviour($("#specServiceIdId").val()); + } + $("#specServiceIdId").on("change",function(){ + ajaxBehaviour($(this).val()); + }); }); +var ajaxBehaviour=function(val){ + var pathName=window.document.location.pathname.substring(0,window.document.location.pathname.indexOf("/nis")+4); + var request=$.ajax({ + type:'post', + url:pathName+'/specific/specificServiceCfg/childrenList', + data:{"parent":val}, + dataType:'json', + async:true, + success:function(data,textStatus){//处理返回结果 + if(textStatus=="success"){ + if(data.length>0){ + var html=''; + $("#behaviour").prev("label").removeClass("hidden"); + $("#behaviour").html(html); + $("[name='userRegion1']").selectpicker("refresh"); + $("[name='userRegion1']").selectpicker("render"); + }else{ + if($("#behaviour").prev("label").is(":visible")){ + $("#behaviour").prev("label").addClass("hidden"); + $("#behaviour").html(""); + } + } + + } + }, + complete:function(XMLHttpRequest,status){//超时设置 + if(status=="timeout"){ + if($("#behaviour").prev("label").is(":visible")){ + $("#behaviour").prev("label").addClass("hidden"); + $("#behaviour").html(""); + } + } + } + }); +} //业务窗口打开 var addContent = function(obj, contentClassName) { var showDiv = $(obj).parent().parent().next(); @@ -76,6 +126,9 @@ var delContent = function(contentClassName, addBtnClassName) {
+ + +

@@ -109,6 +162,16 @@ var delContent = function(contentClassName, addBtnClassName) { +
+
+
+ +
+ +
+
+
+
@@ -117,20 +180,16 @@ var delContent = function(contentClassName, addBtnClassName) {
-
-
- -
- -
-
+ +
+
diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp index 1d16ea7b8..0ae7b8ea8 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appPolicyCfgList.jsp @@ -310,6 +310,7 @@ + @@ -337,6 +338,7 @@ ${cfg.cfgDesc } ${cfg.appName } + ${cfg.userRegion1 } ${cfg.ratelimit } diff --git a/src/main/webapp/WEB-INF/views/specific/specificServiceCfgForm.jsp b/src/main/webapp/WEB-INF/views/specific/specificServiceCfgForm.jsp index f2b9ed711..b5cdd3a7f 100644 --- a/src/main/webapp/WEB-INF/views/specific/specificServiceCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/specific/specificServiceCfgForm.jsp @@ -115,7 +115,7 @@
- +
@@ -130,6 +130,14 @@
--%> +
+ +
+ + + +
+
diff --git a/src/main/webapp/WEB-INF/views/specific/specificServiceCfgList.jsp b/src/main/webapp/WEB-INF/views/specific/specificServiceCfgList.jsp index a556e1911..802803142 100644 --- a/src/main/webapp/WEB-INF/views/specific/specificServiceCfgList.jsp +++ b/src/main/webapp/WEB-INF/views/specific/specificServiceCfgList.jsp @@ -255,6 +255,7 @@ + @@ -268,6 +269,10 @@ ${fns:abbr(specificServiceCfg.specServiceDesc,15)} ${specificServiceCfg.groupId } + + + + <%--