diff --git a/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java b/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java index 806641e01..d859fbdf2 100644 --- a/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java +++ b/src/main/java/com/nis/web/controller/configuration/EncryptedTunnelBehaviorController.java @@ -19,7 +19,9 @@ import com.nis.domain.Page; import com.nis.domain.SysDataDictionaryItem; import com.nis.domain.configuration.AppPolicyCfg; import com.nis.domain.configuration.IpPortCfg; +import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.domain.specific.SpecificServiceCfg; +import com.nis.exceptions.CallExternalProceduresException; import com.nis.exceptions.MaatConvertException; import com.nis.util.Constants; import com.nis.util.DictUtils; @@ -96,6 +98,15 @@ public class EncryptedTunnelBehaviorController extends BaseController { } } } + 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); @@ -139,9 +150,15 @@ public class EncryptedTunnelBehaviorController extends BaseController { entity.setAppCode(specificService.getSpecServiceCode()); } appCfgService.saveOrUpdateAppPolicyCfg(entity); + addMessage(redirectAttributes,"save_success"); } catch (Exception e) { e.printStackTrace(); - addMessage(redirectAttributes, e.getMessage()); + logger.error("加密隧道信息保存失败",e); + if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) { + throw new MaatConvertException(""); + }else { + addMessage(redirectAttributes,"save_failed"); + } } return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+entity.getFunctionId(); @@ -170,10 +187,17 @@ public class EncryptedTunnelBehaviorController extends BaseController { entity.setConfigType(Constants.SPECIFIC_SERVICE_CFG_TYPE_ENCRYPTED_TUNNEL_BEHAVIOR); try { appCfgService.auditAppPolicyCfg(entity,isAudit); - } catch (MaatConvertException e) { - e.printStackTrace(); - logger.info("app策略配置下发失败:"+e.getMessage()); - addMessage(redirectAttributes, e.getMessage()); + addMessage(redirectAttributes,"audit_success"); + } catch (Exception e) { + if(e instanceof MaatConvertException) { + e.printStackTrace(); + logger.info("加密隧道配置下发失败:"+e.getMessage());; + throw new MaatConvertException(""); + }else { + e.printStackTrace(); + logger.error("加密隧道配置下发失败",e); + addMessage(redirectAttributes,"audit_failed"); + } } } return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+functionId; @@ -187,8 +211,19 @@ public class EncryptedTunnelBehaviorController extends BaseController { */ @RequestMapping(value = {"updateValid"}) @RequiresPermissions(value={"encryptedtunnelbehav:config"}) - public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId) { - appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId); + public String updateAppPolicyCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) { + try { + appCfgService.updateAppPolicyCfgValid(isValid,ids,functionId); + } catch (Exception e) { + logger.error("加密隧道协议保存失败",e); + if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) { + e.printStackTrace(); + throw new MaatConvertException(""); + }else { + e.printStackTrace(); + addMessage(redirectAttributes,"delete_failed"); + } + } return "redirect:" + adminPath +"/encryptedtunnelbehav/list?functionId="+functionId; } } diff --git a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp index 067736bdc..336ffe94a 100644 --- a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/form.jsp @@ -217,6 +217,26 @@ var delContent = function(contentClassName, addBtnClassName) {
+
+
+ + + + + + + + + + + +
+
+
@@ -226,25 +246,7 @@ var delContent = function(contentClassName, addBtnClassName) {
-
-
- - - - - - - - - - - -
-
+ diff --git a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp index 8a1035e63..3c0f67483 100644 --- a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp @@ -35,6 +35,7 @@ $(".Wdate").attr("value",''); $("#level").attr("value",''); $("#searchForm")[0].reset(); + $("#intype").attr("placeholder"," "+$("#seltype").find("option:selected").text()); }); //异步获取策略ip相关信息 $("span[id^=open]").click(function(){ @@ -147,7 +148,7 @@ - + diff --git a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp index bee54a4ac..fc51e2833 100644 --- a/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/encryptedtunnelbehav/form.jsp @@ -5,9 +5,10 @@ <spring:message code="encrypted_tunnel_behavior"></spring:message>