diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/XmppController.java b/src/main/java/com/nis/web/controller/configuration/ntc/XmppController.java index ce6a23cf8..739a014c6 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/XmppController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/XmppController.java @@ -27,6 +27,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.IpPortCfg; +import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.exceptions.MaatConvertException; import com.nis.web.controller.BaseController; import com.nis.web.security.UserUtils; @@ -104,6 +105,15 @@ public class XmppController extends BaseController { } } } + if(cfg.getNtcSubscribeIdCfgList()!=null){ + String cfgType = null; + for(NtcSubscribeIdCfg keyword:cfg.getNtcSubscribeIdCfgList()){ + if(!keyword.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"2",keyword.getCfgType()}); + cfgType = keyword.getCfgType(); + } + } + } model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); diff --git a/src/main/java/com/nis/web/dao/configuration/XmppCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/XmppCfgDao.xml index 758388079..3c0e87e07 100644 --- a/src/main/java/com/nis/web/dao/configuration/XmppCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/XmppCfgDao.xml @@ -23,6 +23,7 @@ + @@ -121,7 +122,7 @@ a.CFG_ID,a.CFG_DESC,a.ACTION,a.IS_VALID,a.IS_AUDIT, a.CREATOR_ID,a.CREATE_TIME,a.EDITOR_ID,a.EDIT_TIME,a.AUDITOR_ID,a.AUDIT_TIME, 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.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,do_log a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port @@ -301,7 +302,8 @@ ATTRIBUTE, LABLE, AREA_EFFECTIVE_IDS, - function_id + function_id, + do_log )values ( #{cfgDesc,jdbcType=VARCHAR}, #{action,jdbcType=INTEGER}, @@ -321,7 +323,8 @@ #{attribute,jdbcType=VARCHAR}, #{lable,jdbcType=VARCHAR}, #{areaEffectiveIds,jdbcType=VARCHAR}, - #{functionId,jdbcType=INTEGER} + #{functionId,jdbcType=INTEGER}, + #{doLog,jdbcType=INTEGER} ) @@ -445,6 +448,9 @@ function_id = #{functionId,jdbcType=INTEGER}, + + + do_log = #{doLog,jdbcType=INTEGER}, diff --git a/src/main/java/com/nis/web/service/configuration/XmppCfgService.java b/src/main/java/com/nis/web/service/configuration/XmppCfgService.java index 21d0a2aa7..0c6559524 100644 --- a/src/main/java/com/nis/web/service/configuration/XmppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/XmppCfgService.java @@ -15,6 +15,7 @@ import com.nis.domain.configuration.AreaIpCfg; import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.ComplexkeywordCfg; import com.nis.domain.configuration.IpPortCfg; +import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.domain.maat.MaatCfg; import com.nis.domain.maat.MaatCfg.DigestCfg; import com.nis.domain.maat.MaatCfg.GroupCfg; @@ -28,6 +29,7 @@ import com.nis.util.ConfigServiceUtil; import com.nis.util.Constants; import com.nis.util.StringUtil; import com.nis.web.dao.configuration.AreaIpCfgDao; +import com.nis.web.dao.configuration.StringCfgDao; import com.nis.web.dao.configuration.XmppCfgDao; import com.nis.web.security.UserUtils; import com.nis.web.service.CrudService; @@ -43,10 +45,19 @@ public class XmppCfgService extends CrudService { protected XmppCfgDao xmppCfgDao; @Autowired protected AreaIpCfgDao areaIpCfgDao; + @Autowired + protected StringCfgDao stringCfgDao; public CfgIndexInfo getXmppCfg(Long cfgId){ CfgIndexInfo entity = xmppCfgDao.getCfgIndexInfo(cfgId); List ipPortList = xmppCfgDao.getIpPortList(entity); + //设置关键字 + if(entity.getCompileId()!=null){ + NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg(); + ntcSubscribeIdCfg.setCompileId(entity.getCompileId()); + List ntcList = stringCfgDao.findSubscribeIdCfgList(ntcSubscribeIdCfg); + entity.setNtcSubscribeIdCfgList(ntcList); + } entity.setIpPortList(ipPortList); return entity; } @@ -68,6 +79,10 @@ public class XmppCfgService extends CrudService { if(idList!=null && idList.size()>0){ compileId = idList.get(0); } + } catch (MaatConvertException e) { + logger.info("获取编译ID出错"); + throw new MaatConvertException(""); + } entity.setCompileId(compileId); entity.setCreateTime(new Date()); entity.setCreatorId(entity.getCurrentUser().getId()); @@ -78,6 +93,14 @@ public class XmppCfgService extends CrudService { xmppCfgDao.saveIpPortCfg(cfg); } } + if(entity.getNtcSubscribeIdCfgList()!=null){ + for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ + if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + stringCfgDao.saveSubscribeIdCfg(cfg); + } + } + } //保存区域IP信息 if(entity.getAreaCfg()!=null){ for(AreaIpCfg cfg:entity.getAreaCfg()){ @@ -86,16 +109,13 @@ public class XmppCfgService extends CrudService { areaIpCfgDao.saveAreaIpCfg(cfg); } } - } catch (Exception e) { - e.printStackTrace(); - logger.info("获取编译ID出错"); - throw new MaatConvertException(":"+e.getMessage()); - } + }else{ xmppCfgDao.updateCfgIndex(entity); //无效子配置后,再新增子配置 xmppCfgDao.deleteXmppIpCfg(entity); + stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity); AreaIpCfg area = new AreaIpCfg(); area.setCompileId(entity.getCompileId()); area.setFunctionId(entity.getFunctionId()); @@ -108,6 +128,14 @@ public class XmppCfgService extends CrudService { xmppCfgDao.saveIpPortCfg(cfg); } } + if(entity.getNtcSubscribeIdCfgList()!=null){ + for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ + if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + stringCfgDao.saveSubscribeIdCfg(cfg); + } + } + } //保存区域IP信息 if(entity.getAreaCfg()!=null){ for(AreaIpCfg cfg:entity.getAreaCfg()){ @@ -137,6 +165,13 @@ public class XmppCfgService extends CrudService { cfg.setTableName(IpPortCfg.getTablename()); xmppCfgDao.updateCfgValid(cfg); } + if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0) + { + NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(NtcSubscribeIdCfg.getTablename()); + xmppCfgDao.updateCfgValid(cfg); + } // if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){ // HttpUrlCfg cfg = new HttpUrlCfg(); // BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); @@ -185,6 +220,17 @@ public class XmppCfgService extends CrudService { } } } + if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){ + NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(NtcSubscribeIdCfg.getTablename()); + xmppCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + } // if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){ // HttpUrlCfg cfg = new HttpUrlCfg(); // BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); diff --git a/src/main/webapp/WEB-INF/views/cfg/other/xmppForm.jsp b/src/main/webapp/WEB-INF/views/cfg/other/xmppForm.jsp index b1b136fee..2574baca3 100644 --- a/src/main/webapp/WEB-INF/views/cfg/other/xmppForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/other/xmppForm.jsp @@ -178,7 +178,33 @@ + +
+
+
+ + + + + + + + + + + + +
+
+
+ + + @@ -212,6 +238,48 @@ + + + +

+ + +

+ + + + + + + +
+ <%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%> +
+ + +
+
+
+ + + + +
+ + + + +
+
+
+ +

diff --git a/src/main/webapp/WEB-INF/views/cfg/other/xmppList.jsp b/src/main/webapp/WEB-INF/views/cfg/other/xmppList.jsp index 151b2ff4d..5c17a4baf 100644 --- a/src/main/webapp/WEB-INF/views/cfg/other/xmppList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/other/xmppList.jsp @@ -9,7 +9,9 @@ //搜索框提示语初始化 if("${cfg.cfgDesc}"){ $("#intype").val("${cfg.cfgDesc}"); - }else{ + }else if("${cfg.compileId}"){ + $("#intype").val("${cfg.compileId}"); + } else{ $("#intype").attr("placeholder"," "+$("#seltype").find("option:selected").text()); } $("#seltype").change(function(){ @@ -30,6 +32,7 @@ $(".Wdate").attr("value",''); $("#level").attr("value",''); $("#searchForm")[0].reset(); + $("#intype").attr("placeholder"," "+$("#seltype").find("option:selected").text()); }); //异步获取voip相关信息 $("span[id^=open]").click(function(){ @@ -132,6 +135,7 @@ + <%-- @@ -305,8 +309,10 @@ + + @@ -329,6 +335,7 @@ + ${indexCfg.compileId } ${indexCfg.cfgDesc } @@ -337,6 +344,13 @@ + + + + + + + diff --git a/src/main/webapp/WEB-INF/views/cfg/other/xmppSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/other/xmppSubList.jsp index e03edbf18..ee5700462 100644 --- a/src/main/webapp/WEB-INF/views/cfg/other/xmppSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/other/xmppSubList.jsp @@ -120,6 +120,60 @@ + + + + +
+
+
+
+ +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+