diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java b/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java index 24e519955..5f5a86ee5 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java @@ -3,7 +3,6 @@ package com.nis.web.controller.configuration.ntc; import java.util.ArrayList; import java.util.Date; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Properties; @@ -13,7 +12,6 @@ import javax.servlet.http.HttpServletResponse; import org.apache.commons.lang3.StringUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.context.i18n.LocaleContextHolder; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.ModelAttribute; @@ -22,27 +20,22 @@ import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.support.RedirectAttributes; import com.nis.domain.Page; -import com.nis.domain.SysUser; import com.nis.domain.basics.ServiceDictInfo; import com.nis.domain.basics.SysDictInfo; import com.nis.domain.configuration.AreaBean; import com.nis.domain.configuration.AreaIpCfg; -import com.nis.domain.configuration.AvContIpCfg; import com.nis.domain.configuration.AvVoipAccountCfg; 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.domain.configuration.AvVoipIpCfg; import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.BaseStringCfg; -import com.nis.util.Configurations; import com.nis.util.Constants; import com.nis.util.DateUtils; import com.nis.util.StringUtil; import com.nis.util.excel.ExportExcel; import com.nis.web.controller.BaseController; -import com.nis.web.security.UserUtils; /** * 处理音视频文本业务 @@ -55,11 +48,11 @@ public class AvContentController extends BaseController { /*****************************voip业务***************/ //音视频VOIP IP配置新增界面 @RequestMapping(value = {"/voipForm"}) - @RequiresPermissions(value={"avVoipIp:config"}) + @RequiresPermissions(value={"avVoip:config"}) public String voipFrom(Model model,HttpServletRequest request ,HttpServletResponse response ,String compileIds,String ids, CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ - if(!StringUtil.isEmpty(compileIds)){ - cfg.setCompileId(Integer.parseInt(compileIds)); + if(!StringUtil.isEmpty(ids)){ + cfg.setCfgId(Long.parseLong(ids)); cfg = avContentCfgService.getCfgIndexInfo(cfg); initUpdateFormCondition(model, cfg); }else{ @@ -70,7 +63,7 @@ public class AvContentController extends BaseController { return "/cfg/av/voip/voipForm"; } //音视频VOIP Account配置新增界面 - @RequestMapping(value = {"/voipAccountForm"}) +/* @RequestMapping(value = {"/voipAccountForm"}) @RequiresPermissions(value={"avVoipAccount:config"}) public String voipAccountForm(Model model,HttpServletRequest request ,HttpServletResponse response ,String compileIds,String ids, CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ @@ -85,7 +78,7 @@ public class AvContentController extends BaseController { model.addAttribute("_cfg", cfg); return "/cfg/av/voip/voipAccountForm"; - } + }*/ //保存voip ip信息 @RequestMapping(value = {"/saveVoip"}) @@ -97,18 +90,18 @@ public class AvContentController extends BaseController { }catch(Exception e){ if(e instanceof MaatConvertException) { e.printStackTrace(); - logger.error("voip IP信息保存失败",e); + logger.error("voip 信息保存失败",e); addMessage(redirectAttributes,"request_service_failed"); }else { e.printStackTrace(); - logger.error("voip IP信息保存失败",e); + logger.error("voip 信息保存失败",e); addMessage(redirectAttributes,"save_failed"); } } return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+cfg.getFunctionId(); } //保存voip Account信息 - @RequestMapping(value = {"/saveAccountVoip"}) +/* @RequestMapping(value = {"/saveAccountVoip"}) public String saveAccountVoip(Model model,HttpServletRequest request,HttpServletResponse response,String ids, CfgIndexInfo cfg ,RedirectAttributes redirectAttributes){ try{ @@ -126,12 +119,10 @@ public class AvContentController extends BaseController { } } return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+cfg.getFunctionId(); - } - //视频文本VOIP IP配置列表 + }*/ + //视频文本VOIP 配置列表 @RequestMapping(value = {"/voipList"}) - public String voipCfgList(Model model,HttpServletRequest request - ,HttpServletResponse response - ,@ModelAttribute("cfg")CfgIndexInfo entity + public String voipCfgList(Model model,HttpServletRequest request ,HttpServletResponse response ,@ModelAttribute("cfg")CfgIndexInfo entity ,RedirectAttributes redirectAttributes){ if(entity.getVoipIp()== null){ entity.setVoipIp(new AvVoipIpCfg()); @@ -148,7 +139,7 @@ public class AvContentController extends BaseController { return "/cfg/av/voip/voipList"; } //视频文本VOIP Account配置列表 - @RequestMapping(value = {"/voipAccountList"}) +/* @RequestMapping(value = {"/voipAccountList"}) public String voipCfgAccountList(Model model,HttpServletRequest request ,HttpServletResponse response ,@ModelAttribute("cfg")CfgIndexInfo entity ,RedirectAttributes redirectAttributes){ if(entity.getVoipAccount()== null){ @@ -161,12 +152,12 @@ public class AvContentController extends BaseController { model.addAttribute("page", page); initPageCondition(model,entity); return "/cfg/av/voip/voipAccountList"; - } + }*/ //修改VOIP IP配置状态 @RequestMapping(value = {"/updateAvVoipValid"}) - @RequiresPermissions(value={"avVoipIp:config"}) + @RequiresPermissions(value={"avVoip:config"}) public String updateVoipValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId ,RedirectAttributes redirectAttributes ) { @@ -175,18 +166,18 @@ public class AvContentController extends BaseController { } catch (Exception e) { if(e instanceof MaatConvertException) { e.printStackTrace(); - logger.error("voip IP信息审核失败",e); + logger.error("voip 信息审核失败",e); addMessage(redirectAttributes,"request_service_failed"); }else { e.printStackTrace(); - logger.error("voip IP信息审核失败",e); + logger.error("voip 信息审核失败",e); addMessage(redirectAttributes,"audit_failed"); } } return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+functionId; } //修改VOIP account配置状态 - @RequestMapping(value = {"/updateAvVoipAccountValid"}) +/* @RequestMapping(value = {"/updateAvVoipAccountValid"}) @RequiresPermissions(value={"avVoipAccount:config"}) public String updateVoipAccountValid(Integer isAudit,String compileIds,Integer isValid,String ids,Integer functionId ,RedirectAttributes redirectAttributes @@ -205,15 +196,13 @@ public class AvContentController extends BaseController { } } return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+functionId; - } + }*/ //修改VOIP IP配置审核状态 @RequestMapping(value = {"/auditAvVoip"}) - @RequiresPermissions(value={"avVoipIp:confirm"}) - public String auditVoip(Integer isAudit,Integer isValid,String ids - ,String compileIds,Integer functionId - ,RedirectAttributes redirectAttributes) { - if(!StringUtil.isEmpty(compileIds)){ - String[] idArray = compileIds.split(","); + @RequiresPermissions(value={"avVoip:confirm"}) + public String auditVoip(Integer isAudit,Integer isValid,String ids ,String compileIds,Integer functionId ,RedirectAttributes redirectAttributes) { + if(!StringUtil.isEmpty(ids)){ + String[] idArray = ids.split(","); Date auditTime=new Date(); for(String id :idArray){ try { @@ -221,7 +210,7 @@ public class AvContentController extends BaseController { } catch (MaatConvertException e) { if(e instanceof MaatConvertException) { e.printStackTrace(); - logger.info("VOIP配置下发失败:"+e.getMessage());; + logger.error("VOIP配置下发失败:"+e.getMessage());; addMessage(redirectAttributes,"request_service_failed"); }else { e.printStackTrace(); @@ -236,7 +225,7 @@ public class AvContentController extends BaseController { return "redirect:" + adminPath +"/ntc/av/voipList?functionId="+functionId; } //修改VOIP IP配置审核状态 - @RequestMapping(value = {"/auditAvVoipAccount"}) +/* @RequestMapping(value = {"/auditAvVoipAccount"}) @RequiresPermissions(value={"avVoipAccount:confirm"}) public String auditVoipAccount(Integer isAudit,Integer isValid,String ids ,String compileIds,Integer functionId @@ -262,14 +251,14 @@ public class AvContentController extends BaseController { } return "redirect:" + adminPath +"/ntc/av/voipAccountList?functionId="+functionId; - } + }*/ /** * 账号account * 根据索引表信息异步获取子表信息 * @return */ - @ResponseBody + /*@ResponseBody @RequestMapping(value = "ajaxVoipAccountInfo") public Map getVoipAccountInfo(CfgIndexInfo cfgIndexInfo) { Map voipAndAccountInfoMap=new HashMap(); @@ -282,25 +271,50 @@ public class AvContentController extends BaseController { voipAndAccountInfoMap.put("account", voipAccountCfgList); voipAndAccountInfoMap.put("subscribe", ntcSubscribeIdCfgList); return voipAndAccountInfoMap; - } + }*/ /** * 根据索引表信息异步获取子表信息 * @return */ - @ResponseBody - @RequestMapping(value = "ajaxVoipIpInfo") - public Map getVoipIpInfo(CfgIndexInfo cfgIndexInfo) { - Map voipAndAccountInfoMap=new HashMap(); + @RequestMapping(value = {"/ajaxVoipIpInfo"}) + public String getVoipIpInfo(Model model,Long cfgId,Integer index) { + CfgIndexInfo cfgIndexInfo = new CfgIndexInfo(); + cfgIndexInfo.setCfgId(cfgId); + CfgIndexInfo cfg = avContentCfgService.getCfgIndexInfo(cfgIndexInfo); + List tabList = new ArrayList(); //获取voipIpCfg信息 - List voipIpCfgList=new ArrayList(); - List ntcSubscribeIdCfgList=new ArrayList(); - - voipIpCfgList = avContentCfgService.getVoipIpCfgList(cfgIndexInfo); - ntcSubscribeIdCfgList=avContentCfgService.getSubscribeIdCfgList(cfgIndexInfo); - - voipAndAccountInfoMap.put("ip", voipIpCfgList); - voipAndAccountInfoMap.put("subscribe", ntcSubscribeIdCfgList); - return voipAndAccountInfoMap; + if(cfg.getVoipIps()!=null){ + String cfgType = null; + for(AvVoipIpCfg ip:cfg.getVoipIps()){ + if(!ip.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"1",ip.getCfgType()}); + cfgType = ip.getCfgType(); + } + } + } + if(cfg.getVoipAccounts()!=null){ + String cfgType = null; + for(AvVoipAccountCfg account:cfg.getVoipAccounts()){ + if(account!=null&&!account.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"2",account.getCfgType()}); + cfgType = account.getCfgType(); + } + } + } + //查询关键字 + if(cfg.getNtcSubscribeIdCfgList()!=null){ + String cfgType = null; + for(NtcSubscribeIdCfg ntc:cfg.getNtcSubscribeIdCfgList()){ + if(!ntc.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"2",ntc.getCfgType()}); + cfgType = ntc.getCfgType(); + } + } + } + model.addAttribute("_cfg", cfg); + model.addAttribute("index", index); + model.addAttribute("tabList", tabList); + return "/cfg/av/voip/voipSubList"; } /*****************************voip业务***************/ diff --git a/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java b/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java index 5bc029af1..dbd11cde5 100644 --- a/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java @@ -78,13 +78,13 @@ public class AvContentCfgService extends BaseService{ * @param entity * @return */ - public Page findAccountPage(Page page, CfgIndexInfo entity) { + /*public Page findAccountPage(Page page, CfgIndexInfo entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r")); entity.setPage(page); List list=avContentCfgDao.findAccountList(entity); page.setList(list); return page; - } + }*/ /** * 根据索引表信息获取voipIpCfg信息 * @param entity @@ -116,20 +116,16 @@ public class AvContentCfgService extends BaseService{ */ public CfgIndexInfo getCfgIndexInfo(CfgIndexInfo entity) { CfgIndexInfo cfg=avContentCfgDao.getCfgIndexInfo(entity); - List ntcSubscribeList=getSubscribeIdCfgList(entity); - if(ntcSubscribeList ==null || ntcSubscribeList.size() <=0){ - ntcSubscribeList.add(new NtcSubscribeIdCfg()); - } - List voipIps=getVoipIpCfgList(entity); - if(voipIps ==null || voipIps.size() <=0){ - voipIps.add(new AvVoipIpCfg()); - } + List ntcSubscribeList=getSubscribeIdCfgList(cfg); + List voipIps=getVoipIpCfgList(cfg); + List voipAccounts=getVoipAccountCfgList(cfg); cfg.setNtcSubscribeIdCfgList(ntcSubscribeList); cfg.setVoipIps(voipIps); + cfg.setVoipAccounts(voipAccounts); return cfg; } - public CfgIndexInfo getCfgIndexInfo2(CfgIndexInfo entity) { +/* public CfgIndexInfo getCfgIndexInfo2(CfgIndexInfo entity) { CfgIndexInfo cfg=avContentCfgDao.getCfgIndexInfo(entity); List voipAccounts=new ArrayList<>(); voipAccounts=getVoipAccountCfgList(entity); @@ -145,7 +141,7 @@ public class AvContentCfgService extends BaseService{ cfg.setNtcSubscribeIdCfgList(ntcSubscribeList); return cfg; - } + }*/ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void saveOrUpdateAvVoip(CfgIndexInfo entity){ @@ -178,6 +174,12 @@ public class AvContentCfgService extends BaseService{ } } } + if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){ + for(AvVoipAccountCfg voipAccount : entity.getVoipAccounts()){ + entity.setVoipAccount(voipAccount); + avContentCfgDao.insertAvVoipAccountCfg(entity); + } + } //保存区域IP信息 if(entity.getAreaCfg()!=null){ for(AreaIpCfg cfg:entity.getAreaCfg()){ @@ -199,6 +201,7 @@ public class AvContentCfgService extends BaseService{ //无效子配置后,再新增子配置 avContentCfgDao.deleteAvVoipIp(entity); stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity); + avContentCfgDao.deleteAvVoipAccountCfg(entity); AreaIpCfg area = new AreaIpCfg(); area.setCompileId(entity.getCompileId()); area.setFunctionId(entity.getFunctionId()); @@ -219,6 +222,12 @@ public class AvContentCfgService extends BaseService{ } } } + if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){ + for (AvVoipAccountCfg voipAccount : entity.getVoipAccounts()) { + entity.setVoipAccount(voipAccount); + avContentCfgDao.insertAvVoipAccountCfg(entity); + } + } //保存区域IP信息 if(entity.getAreaCfg()!=null){ for(AreaIpCfg cfg:entity.getAreaCfg()){ @@ -230,7 +239,7 @@ public class AvContentCfgService extends BaseService{ } } - @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + /*@Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void saveOrUpdateAvVoipAccount(CfgIndexInfo entity){ //设置区域运营商信息 setAreaEffectiveIds(entity); @@ -311,7 +320,7 @@ public class AvContentCfgService extends BaseService{ } } } - } + }*/ /** @@ -333,6 +342,7 @@ public class AvContentCfgService extends BaseService{ entity.setEditTime(new Date()); avContentCfgDao.updateAvVoipIp(entity); avContentCfgDao.updateAvVoipKeywordCfgt(entity); + avContentCfgDao.updateAvVoipAccount(entity); avContentCfgDao.updateCfgIndexInfo(entity); AreaIpCfg areaIpCfg=new AreaIpCfg(); BeanUtils.copyProperties(entity, areaIpCfg); @@ -345,7 +355,7 @@ public class AvContentCfgService extends BaseService{ * @param isValid * @param ids compileIds */ - @Transactional(readOnly=false,rollbackFor=RuntimeException.class) +/* @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void updateAvVoipAccountValid(Integer isAudit,Integer isValid,String compileIds,Integer functionId){ String[] idArray = compileIds.split(","); for(String id :idArray){ @@ -363,7 +373,7 @@ public class AvContentCfgService extends BaseService{ BeanUtils.copyProperties(entity, areaIpCfg); areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg); } - } + }*/ /** * * @param isAudit @@ -372,16 +382,17 @@ public class AvContentCfgService extends BaseService{ * @param functionId */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public void auditAvVoip(Integer isAudit,Integer isValid,Integer functionId,String compileId,Date auditTime){ + public void auditAvVoip(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime){ CfgIndexInfo entity = new CfgIndexInfo(); List list = new ArrayList(); List voipIpList = new ArrayList(); List ntcList = new ArrayList(); + List accountList = new ArrayList(); List areaIpCfgList = new ArrayList(); CfgIndexInfo searchCfg=new CfgIndexInfo(); - searchCfg.setCompileId(Integer.parseInt(compileId)); + searchCfg.setCfgId(Long.parseLong(id)); entity = avContentCfgDao.getCfgIndexInfo(searchCfg); entity.setIsAudit(isAudit); @@ -390,6 +401,7 @@ public class AvContentCfgService extends BaseService{ entity.setAuditTime(auditTime); avContentCfgDao.updateAvVoipIp(entity); + avContentCfgDao.updateAvVoipAccount(entity); avContentCfgDao.updateAvVoipKeywordCfgt(entity); avContentCfgDao.updateCfgIndexInfo(entity); @@ -398,6 +410,7 @@ public class AvContentCfgService extends BaseService{ areaIpCfgDao.updateAreaIpCfg(areaIpCfg); voipIpList=avContentCfgDao.findVoipIpCfgList(entity); + accountList=avContentCfgDao.findVoipAccountCfgList(entity); ntcList=stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity); areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); @@ -423,6 +436,11 @@ public class AvContentCfgService extends BaseService{ groupRelationList=ntcMap.get("groupList"); strRegionList=ntcMap.get("dstList"); } + if(!StringUtil.isEmpty(accountList)){ + Map accountMap = cfgConvert(strRegionList,accountList,2,entity,groupRelationList); + groupRelationList=accountMap.get("groupList"); + strRegionList=accountMap.get("dstList"); + } if(!StringUtil.isEmpty(areaIpCfgList)){ Map areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList); groupRelationList=areaMap.get("groupList"); @@ -452,10 +470,10 @@ public class AvContentCfgService extends BaseService{ maatBean.setOpAction(Constants.INSERT_ACTION); //调用服务接口下发配置数据 String json=gsonToJson(maatBean); - logger.info("voip IP配置下发配置参数:"+json); + logger.info("voip 配置下发配置参数:"+json); //调用服务接口下发配置 ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); - logger.info("voip IP配置下发响应信息:"+result.getMsg()); + logger.info("voip 配置下发响应信息:"+result.getMsg()); }else if(isAudit==3){ maatCfg.setCompileId(entity.getCompileId()); @@ -469,15 +487,15 @@ public class AvContentCfgService extends BaseService{ maatBean.setOpAction(Constants.UPDATE_ACTION); //调用服务接口取消配置 String json=gsonToJson(maatBean); - logger.info("voip IP配置下发配置参数:"+json); + logger.info("voip 配置下发配置参数:"+json); //调用服务接口下发配置 ToMaatResult result = ConfigServiceUtil.put(json,1); - logger.info("voip IP配置取消配置响应信息:"+result.getMsg()); + logger.info("voip 配置取消配置响应信息:"+result.getMsg()); } } - /********************************voip业务*********************************/ + /********************************voip account业务*********************************/ /** * * @param isAudit @@ -485,7 +503,7 @@ public class AvContentCfgService extends BaseService{ * @param ids 编译Id * @param functionId */ - @Transactional(readOnly=false,rollbackFor=RuntimeException.class) +/* @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void auditAvVoipAccount(Integer isAudit,Integer isValid,Integer functionId,String compileId,Date auditTime){ CfgIndexInfo entity = new CfgIndexInfo(); @@ -591,7 +609,7 @@ public class AvContentCfgService extends BaseService{ } - } + }*/ /********************************voip业务*********************************/ diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp index 991995a81..f0e433c1f 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp @@ -37,17 +37,27 @@ } }, submitHandler : function(form) { - var flag = true; - var subscribeId=0; //存在隐藏的subscribeId,不算进域配置 - if($(".boxSolid.hidden").hasClass("subscribeId")){ - subscribeId=1; - } - //代表所有业务都隐藏了,提示必须增加一种业务数据 - if(($(".boxSolid").length - 1) == ($(".boxSolid.hidden").length - subscribeId)){ - top.$.jBox.tip("", ""); - return; + if($(".boxSolid[class~='subscribeId']").length>0){ + if($(".boxSolid.hidden[class~='subscribeId']").is(":hidden")){ + if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){ + top.$.jBox.tip("", ""); + return; + } + } + if(!$(".boxSolid.hidden[class~='subscribeId']").is(":hidden")){ + if(($(".boxSolid").length) == ($(".boxSolid.hidden").length) + 1){ + top.$.jBox.tip("", ""); + return; + } + } + //代表所有业务都隐藏了,提示必须增加一种业务数据 + }else{ + if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){ + top.$.jBox.tip("", ""); + return; + } } //代表所有区域都隐藏了,提示必须增加个区域信息 if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){ @@ -134,7 +144,7 @@

- +

@@ -228,6 +238,7 @@ + @@ -260,7 +271,49 @@ + + + +

+ + +

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

@@ -269,7 +322,6 @@ onClick="addContent(this,'${tabName}')" title="add">

- <%-- --%> @@ -299,6 +351,7 @@
+

<%@include file="/WEB-INF/include/form/areaInfo.jsp"%> diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountForm.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp.bak similarity index 80% rename from src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountForm.jsp rename to src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp.bak index c85a72805..991995a81 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipForm.jsp.bak @@ -14,25 +14,28 @@ .ready( function() { $(".glyphicon-plus").first().click(); + /* $("#cancel").on("click", function() { + window.history.back(); + });*/ $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); var action=$("input[name='action']:checked").val(); switchAction(action); - }); + }); $("#serviceId").val($(".action:checked").attr("serviceId")); $("#protocolId").val($(".action:checked").attr("protocolId")); $("#cfgFrom").validate( { errorPlacement : function(error, element) { - if($(element).parents().hasClass("tagsinput")){ - $(element).parents(".col-md-6").next("div").append(error); - }else{ - $(element).parents(".form-group").find( - "div[for='" - + element.attr("name") - + "']").append(error); - } - }, + if($(element).parents().hasClass("tagsinput")){ + $(element).parents(".col-md-6").next("div").append(error); + }else{ + $(element).parents(".form-group").find( + "div[for='" + + element.attr("name") + + "']").append(error); + } + }, submitHandler : function(form) { var flag = true; @@ -131,7 +134,7 @@

- +

@@ -149,7 +152,7 @@
-
@@ -158,6 +161,8 @@ value="${_cfg.serviceId}">
+ +
@@ -169,25 +174,24 @@
+
- +
- @@ -195,8 +199,9 @@
+
- +
@@ -214,56 +219,48 @@ +
- + + - - + +

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

@@ -272,6 +269,7 @@ onClick="addContent(this,'${tabName}')" title="add">

+ <%-- --%> @@ -301,7 +299,6 @@
-

<%@include file="/WEB-INF/include/form/areaInfo.jsp"%> diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp index 477eb2d81..2d5d4618a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp @@ -3,9 +3,6 @@ <spring:message code="${cfgName}"></spring:message> - - - @@ -27,6 +24,8 @@ $("#intype").val("${cfg.cfgDesc}"); }else if("${cfg.voipIp.srcIpAddress}"){ $("#intype").val("${cfg.voipIp.srcIpAddress}"); + }else if("${cfg.voipAccount.cfgKeywords}"){ + $("#intype").val("${cfg.voipAccount.cfgKeywords}"); }else if("${cfg.compileId}"){ $("#intype").val("${cfg.compileId}"); }else if("${cfg.voipIp.srcPort}"){ @@ -64,10 +63,8 @@ var index=$(this).attr("id").replace("open",""); $("#"+openId).hide(); $("#"+closeId).show(); - var compileId=$(this).attr("compileId"); + //var compileId=$(this).attr("compileId"); var cfgId=$(this).attr("cfgId"); - var hasIp=false; - var hasSubscribe=false; if($("#"+openId).parent().parent().next("tr").hasClass("child")){ $("#"+openId).parent().parent().next("tr").show(); }else{ @@ -75,305 +72,22 @@ type:'post', async:false, url:'${ctx}/ntc/av/ajaxVoipIpInfo', - data:{"compileId":compileId,"cfgId":cfgId}, + data:{"cfgId":cfgId,"index":index}, + dataType:"html", success:function(data){ - var voipIpCfgTab=""+ - ""+ - ""+ - ""+ - ""; + var subTab=""+ + ""+ + ""+ + ""+ + ""; var html=""; html+="
"; - if(data.subscribe.length >0){ - hasSubscribe=true; - html+="
"; - html+=""; - html+=""; - html+=""; - html+="
"; - } - if(data.ip.length >0){ - hasIp=true; - html+="
"; - html+=""; - html+=""; - html+=""; - html+="
"; - } - - html+="
"; - //subscribe信息 - if(data.subscribe.length > 0){ - html+="
"; - $.each(data.subscribe,function(index,item){ - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+="
"; - html+="
"; - html+="
"; - - if(item.isHexbin==0){ - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - } - if(item.isHexbin==1){ - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - } - if(item.isHexbin==2){ - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - } - - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - /* if(index < (data.ip.length-1) && index != 0){ - alert("下一行"); - } - html+="";*/ - }) - html+="
"; - } - //ip信息 - if(data.ip.length >0){ - html+=""; - - } - - voipIpCfgTab=voipIpCfgTab+html; - voipIpCfgTab+=""; - voipIpCfgTab+=""; - $("#"+openId).parent().parent().after(voipIpCfgTab); - if(hasSubscribe && ! hasIp){ - switchInfo("ip",index); - } - if(hasIp && ! hasSubscribe){ - switchInfo("subscribe",index); - } + html = html+data; + subTab=subTab+html; + subTab+=""; + subTab+=""; + $("#"+openId).parent().parent().after(subTab); + $("div[name='tabTitle"+index+"']").eq(0).click(); } }); } @@ -389,41 +103,13 @@ }); }); - function switchInfo(flag,index){ - //关闭ip信息 - if("ip" ==flag){ - $("#ipInfo"+index).hide(); - $("#downIp"+index).hide(); - $("#ipTitle"+index).removeClass("badge-info"); - $("#subscribeInfo"+index).show(); - $("#subscribeDown"+index).show(); - $("#subscribeUp"+index).hide(); - $("#ipUp"+index).show(); - $("#ipDown"+index).hide(); - $("#subscribeTitle"+index).addClass("badge-info"); - }else{ - //关闭subscribe信息 - $("#subscribeInfo"+index).hide(); - $("#downsubscribe"+index).hide(); - $("#subscribeTitle"+index).removeClass("badge-info"); - $("#ipInfo"+index).show(); - $("#ipDown"+index).show(); - $("#subscribeUp"+index).show(); - $("#subscribeDown"+index).hide(); - $("#ipUp"+index).hide(); - $("#ipTitle"+index).addClass("badge-info"); - } - - - } -

- +

@@ -470,6 +156,7 @@ + @@ -500,12 +187,12 @@
- + <%-- --%> - +
-
+ @@ -682,7 +369,7 @@ diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp.bak similarity index 81% rename from src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountList.jsp rename to src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp.bak index 16564cdaa..bd48b17b4 100644 --- a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipAccountList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipList.jsp.bak @@ -25,12 +25,14 @@ //搜索框提示语初始化 if("${cfg.cfgDesc}"){ $("#intype").val("${cfg.cfgDesc}"); - }else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){ - $("#intype").val("${cfg.ntcSubscribeIdCfg.cfgKeywords}"); + }else if("${cfg.voipIp.srcIpAddress}"){ + $("#intype").val("${cfg.voipIp.srcIpAddress}"); }else if("${cfg.compileId}"){ $("#intype").val("${cfg.compileId}"); - }else if("${cfg.voipAccount.cfgKeywords}"){ - $("#intype").val("${cfg.voipAccount.cfgKeywords}"); + }else if("${cfg.voipIp.srcPort}"){ + $("#intype").val("${cfg.voipIp.srcPort}"); + }else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){ + $("#intype").val("${cfg.ntcSubscribeIdCfg.cfgKeywords}"); }else{ $("#intype").attr("placeholder"," "+$("#seltype").find("option:selected").text()); } @@ -64,15 +66,15 @@ $("#"+closeId).show(); var compileId=$(this).attr("compileId"); var cfgId=$(this).attr("cfgId"); + var hasIp=false; var hasSubscribe=false; - var hasAccount=false; if($("#"+openId).parent().parent().next("tr").hasClass("child")){ $("#"+openId).parent().parent().next("tr").show(); }else{ $.ajax({ type:'post', async:false, - url:'${ctx}/ntc/av/ajaxVoipAccountInfo', + url:'${ctx}/ntc/av/ajaxVoipIpInfo', data:{"compileId":compileId,"cfgId":cfgId}, success:function(data){ var voipIpCfgTab=""+ @@ -82,77 +84,38 @@ ""; voipIpCfgTab+=""; $("#"+openId).parent().parent().after(voipIpCfgTab); - if(hasSubscribe && ! hasAccount){ - switchInfo("account",index); + if(hasSubscribe && ! hasIp){ + switchInfo("ip",index); } - if(hasAccount && ! hasSubscribe){ + if(hasIp && ! hasSubscribe){ switchInfo("subscribe",index); } } @@ -375,30 +390,28 @@ }); function switchInfo(flag,index){ - - if("account" ==flag){ - //关闭account信息 - $("#accountInfo"+index).hide(); - $("#downAccount"+index).hide(); - $("#accountTitle"+index).removeClass("badge-info"); + //关闭ip信息 + if("ip" ==flag){ + $("#ipInfo"+index).hide(); + $("#downIp"+index).hide(); + $("#ipTitle"+index).removeClass("badge-info"); $("#subscribeInfo"+index).show(); $("#subscribeDown"+index).show(); - $("#accountUp"+index).show(); - $("#accountDown"+index).hide(); $("#subscribeUp"+index).hide(); + $("#ipUp"+index).show(); + $("#ipDown"+index).hide(); $("#subscribeTitle"+index).addClass("badge-info"); - }else{ - //关闭subscribe信息 + //关闭subscribe信息 $("#subscribeInfo"+index).hide(); $("#downsubscribe"+index).hide(); $("#subscribeTitle"+index).removeClass("badge-info"); - $("#accountInfo"+index).show(); - $("#accountDown"+index).show(); + $("#ipInfo"+index).show(); + $("#ipDown"+index).show(); $("#subscribeUp"+index).show(); $("#subscribeDown"+index).hide(); - $("#accountUp"+index).hide(); - $("#accountTitle"+index).addClass("badge-info"); + $("#ipUp"+index).hide(); + $("#ipTitle"+index).addClass("badge-info"); } @@ -410,23 +423,23 @@

- +

- + @@ -455,7 +468,8 @@ - + + @@ -486,21 +500,21 @@
- - - + + + <%-- --%> - +
@@ -637,8 +651,8 @@
-
+
- + ${indexCfg.compileId } ${indexCfg.cfgDesc }
"; var html=""; html+="
"; - /* 订阅关键字 */ if(data.subscribe.length >0){ hasSubscribe=true; - html+="
"; + html+="
"; html+=""; html+=""; html+=""; html+="
"; } - - if(data.account.length >0){ - hasAccount=true; - html+="
"; - html+=""; - html+=""; - html+=""; + if(data.ip.length >0){ + hasIp=true; + html+="
"; + html+=""; + html+=""; + html+=""; html+="
"; } - html+="
"; //subscribe信息 if(data.subscribe.length > 0){ - html+="
"; + html+="
"; $.each(data.subscribe,function(index,item){ - //console.log(item.cfgKeywords); html+="
"; html+="
"; html+="
"; - html+="
"; html+="
"; html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+="
"; - html+=""; - html+=""; - html+="
"; - html+="
"; - html+="
"; + if(item.isHexbin==0){ html+="
"; html+="
"; @@ -219,26 +182,7 @@ html+="
"; html+="
"; } - /* if(index < (data.ip.length-1) && index != 0){ - alert("下一行"); - } - html+="";*/ - }) - html+="
"; - } - //account信息 - if(data.account.length > 0){ - html+=""; } + //ip信息 + if(data.ip.length >0){ + html+=""; + + } voipIpCfgTab=voipIpCfgTab+html; voipIpCfgTab+="
diff --git a/src/main/webapp/WEB-INF/views/cfg/av/voip/voipSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipSubList.jsp new file mode 100644 index 000000000..56f7bcc3a --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/av/voip/voipSubList.jsp @@ -0,0 +1,331 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + + + + + +
+ + +
+
+ + + + + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ +
+
+
+ + + +
+
+
+
+ +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+
+
+
+ \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp index f8bfe7d8a..607927741 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp @@ -40,15 +40,26 @@ submitHandler : function(form) { //loading('onloading...'); var flag = true; - var subscribeId=0; //存在隐藏的subscribeId,不算进域配置 - if($(".boxSolid.hidden").hasClass("subscribeId")){ - subscribeId=1; - } - //代表所有业务都隐藏了,提示必须增加一种业务数据 - if(($(".boxSolid").length-1) ==($(".boxSolid.hidden").length-subscribeId)){ - top.$.jBox.tip("", ""); - return; + if($(".boxSolid[class~='subscribeId']").length>0){ + if($(".boxSolid.hidden[class~='subscribeId']").is(":hidden")){ + if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){ + top.$.jBox.tip("", ""); + return; + } + } + if(!$(".boxSolid.hidden[class~='subscribeId']").is(":hidden")){ + if(($(".boxSolid").length) == ($(".boxSolid.hidden").length) + 1){ + top.$.jBox.tip("", ""); + return; + } + } + //代表所有业务都隐藏了,提示必须增加一种业务数据 + }else{ + if(($(".boxSolid").length) == ($(".boxSolid.hidden").length)){ + top.$.jBox.tip("", ""); + return; + } } //代表所有区域都隐藏了,提示必须增加个区域信息 if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){