diff --git a/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java b/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java index da27c0bfe..bc6895c44 100644 --- a/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java +++ b/src/main/java/com/nis/domain/configuration/AppPolicyCfg.java @@ -69,17 +69,17 @@ public class AppPolicyCfg extends BaseCfg { @Expose @ExcelField(title="expression_type") @SerializedName("exprType") - private Integer exprType ; + protected Integer exprType ; @Expose @ExcelField(title="match_method") @SerializedName("matchMethod") - private Integer matchMethod ; + protected Integer matchMethod ; @Expose @ExcelField(title="whether_hexbinary") @SerializedName("isHexbin") - private Integer isHexbin; + protected Integer isHexbin; private List ipPortList; private IpPortCfg ipPort; diff --git a/src/main/java/com/nis/domain/configuration/AppTcpCfg.java b/src/main/java/com/nis/domain/configuration/AppTcpCfg.java new file mode 100644 index 000000000..40270b491 --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/AppTcpCfg.java @@ -0,0 +1,176 @@ +/** + *@Title: BaseStringConfig.java + *@Package com.nis.domain.restful + *@Description TODO + *@author dell + *@date 2018年2月5日 下午5:26:02 + *@version 版本号 + */ +package com.nis.domain.configuration; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import com.nis.util.excel.ExcelField; + +/** + * APP TCP会话字节数特征 + * @author dell + * + */ +public class AppTcpCfg extends BaseCfg { + + /** + * + */ + private static final long serialVersionUID = -4366457794248757698L; + private static final String tableName="app_session_cfg"; + @Expose + private Integer compileId; + @Expose + private Integer ratelimit; + private Integer appCode;//specific_service_cfg表一级节点的spec_service_code + private Integer behavCode;//specific_service_cfg表二级节点的spec_service_code + private Integer specServiceId; + private String district; + private String cfgKeywords; + private String appName; + + /** + * 数值下界 + */ + protected Integer lowBoundary; + /** + * 数值上界 + */ + protected Integer upBoundary; + + @Expose + @ExcelField(title="expression_type") + @SerializedName("exprType") + protected Integer exprType ; + + @Expose + @ExcelField(title="match_method") + @SerializedName("matchMethod") + protected Integer matchMethod ; + + @Expose + @ExcelField(title="whether_hexbinary") + @SerializedName("isHexbin") + protected Integer isHexbin; + + + + + + public Integer getLowBoundary() { + return lowBoundary; + } + + public void setLowBoundary(Integer lowBoundary) { + this.lowBoundary = lowBoundary; + } + + public Integer getUpBoundary() { + return upBoundary; + } + + public void setUpBoundary(Integer upBoundary) { + this.upBoundary = upBoundary; + } + + public Integer getExprType() { + return exprType; + } + + public void setExprType(Integer exprType) { + this.exprType = exprType; + } + + public Integer getMatchMethod() { + return matchMethod; + } + + public void setMatchMethod(Integer matchMethod) { + this.matchMethod = matchMethod; + } + + public Integer getIsHexbin() { + return isHexbin; + } + + public void setIsHexbin(Integer isHexbin) { + this.isHexbin = isHexbin; + } + @Override + public void initDefaultValue() { + // TODO Auto-generated method stub + super.initDefaultValue(); + this.isHexbin = 0; + } + + + public Integer getCompileId() { + return compileId; + } + public void setCompileId(Integer compileId) { + this.compileId = compileId; + } + + public static String getTablename() { + return tableName; + } + + public Integer getRatelimit() { + return ratelimit; + } + + public void setRatelimit(Integer ratelimit) { + this.ratelimit = ratelimit; + } + public Integer getAppCode() { + return appCode; + } + public void setAppCode(Integer appCode) { + this.appCode = appCode; + } + public Integer getSpecServiceId() { + return specServiceId; + } + public void setSpecServiceId(Integer specServiceId) { + this.specServiceId = specServiceId; + } + + public String getDistrict() { + return district; + } + + public void setDistrict(String district) { + this.district = district; + } + + public String getCfgKeywords() { + return cfgKeywords; + } + + public void setCfgKeywords(String cfgKeywords) { + this.cfgKeywords = cfgKeywords; + } + + public String getAppName() { + return appName; + } + + public void setAppName(String appName) { + this.appName = appName; + } + + public Integer getBehavCode() { + return behavCode; + } + + public void setBehavCode(Integer behavCode) { + this.behavCode = behavCode; + } + +} diff --git a/src/main/java/com/nis/domain/configuration/AppTopicDomainCfg.java b/src/main/java/com/nis/domain/configuration/AppTopicDomainCfg.java new file mode 100644 index 000000000..9fb349789 --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/AppTopicDomainCfg.java @@ -0,0 +1,153 @@ +/** + *@Title: BaseStringConfig.java + *@Package com.nis.domain.restful + *@Description TODO + *@author dell + *@date 2018年2月5日 下午5:26:02 + *@version 版本号 + */ +package com.nis.domain.configuration; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; +import com.nis.util.excel.ExcelField; + +/** + * @Description: 主题网站配置 + * @author (dell) + * @date 2018年2月5日 下午5:26:02 + * @version V1.0 + */ +public class AppTopicDomainCfg extends BaseCfg { + + private static final long serialVersionUID = -442502179959427340L; + + private static final String tableName="app_topic_domain_cfg"; + @Expose + private Integer compileId; + @Expose + private Integer ratelimit; +// private Integer appCode;//specific_service_cfg表一级节点的spec_service_code + private Integer behavCode;//specific_service_cfg表二级节点的spec_service_code + private Integer specServiceId; + private String domain; + private String cfgKeywords; + private String appName; + private String topic; + + @Expose + @ExcelField(title="expression_type") + @SerializedName("exprType") + protected Integer exprType ; + + @Expose + @ExcelField(title="match_method") + @SerializedName("matchMethod") + protected Integer matchMethod ; + + @Expose + @ExcelField(title="whether_hexbinary") + @SerializedName("isHexbin") + protected Integer isHexbin; + + + public String getTopic() { + return topic; + } + + public void setTopic(String topic) { + this.topic = topic; + } + + public Integer getExprType() { + return exprType; + } + + public void setExprType(Integer exprType) { + this.exprType = exprType; + } + + public Integer getMatchMethod() { + return matchMethod; + } + + public void setMatchMethod(Integer matchMethod) { + this.matchMethod = matchMethod; + } + + public Integer getIsHexbin() { + return isHexbin; + } + + public void setIsHexbin(Integer isHexbin) { + this.isHexbin = isHexbin; + } + @Override + public void initDefaultValue() { + super.initDefaultValue(); + this.isHexbin = 0; + this.doLog = 0;//app特征域不记录日志 + } + + + public Integer getCompileId() { + return compileId; + } + public void setCompileId(Integer compileId) { + this.compileId = compileId; + } + + public static String getTablename() { + return tableName; + } + + public Integer getRatelimit() { + return ratelimit; + } + + public void setRatelimit(Integer ratelimit) { + this.ratelimit = ratelimit; + } +// public Integer getAppCode() { +// return appCode; +// } +// public void setAppCode(Integer appCode) { +// this.appCode = appCode; +// } + public Integer getSpecServiceId() { + return specServiceId; + } + public void setSpecServiceId(Integer specServiceId) { + this.specServiceId = specServiceId; + } + public String getDomain() { + return domain; + } + public void setDomain(String domain) { + this.domain = domain; + } + public String getCfgKeywords() { + return cfgKeywords; + } + + public void setCfgKeywords(String cfgKeywords) { + this.cfgKeywords = cfgKeywords; + } + + public String getAppName() { + return appName; + } + + public void setAppName(String appName) { + this.appName = appName; + } + + public Integer getBehavCode() { + return behavCode; + } + + public void setBehavCode(Integer behavCode) { + this.behavCode = behavCode; + } + +} diff --git a/src/main/java/com/nis/domain/configuration/FileDigestCfg.java b/src/main/java/com/nis/domain/configuration/FileDigestCfg.java index f77e350af..bc7c7eab3 100644 --- a/src/main/java/com/nis/domain/configuration/FileDigestCfg.java +++ b/src/main/java/com/nis/domain/configuration/FileDigestCfg.java @@ -30,7 +30,10 @@ public class FileDigestCfg extends BaseCfg { private String digest; private Integer cfdsLevel; private String fileUrl; - + + private NtcSubscribeIdCfg ntcSubscribeIdCfg; + private List ntcSubscribeIdCfgList; + public static String getTablename() { return tableName; } @@ -61,5 +64,17 @@ public class FileDigestCfg extends BaseCfg { public void setFileUrl(String fileUrl) { this.fileUrl = fileUrl; } + public NtcSubscribeIdCfg getNtcSubscribeIdCfg() { + return ntcSubscribeIdCfg; + } + public void setNtcSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg) { + this.ntcSubscribeIdCfg = ntcSubscribeIdCfg; + } + public List getNtcSubscribeIdCfgList() { + return ntcSubscribeIdCfgList; + } + public void setNtcSubscribeIdCfgList(List ntcSubscribeIdCfgList) { + this.ntcSubscribeIdCfgList = ntcSubscribeIdCfgList; + } } diff --git a/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java b/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java index 703842e88..d930b4496 100644 --- a/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java +++ b/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java @@ -31,7 +31,14 @@ public class SpecificServiceCfg extends BaseEntity{ private Date endDate; // 结束日期 private String showSequence; //显示序号 private String businessType; + private Integer addFlag;//app界面添加标记 + public Integer getAddFlag() { + return addFlag; + } + public void setAddFlag(Integer addFlag) { + this.addFlag = addFlag; + } public String getBusinessType() { return businessType; } diff --git a/src/main/java/com/nis/web/controller/TagController.java b/src/main/java/com/nis/web/controller/TagController.java index ebedf03a1..049960d7c 100644 --- a/src/main/java/com/nis/web/controller/TagController.java +++ b/src/main/java/com/nis/web/controller/TagController.java @@ -7,6 +7,8 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; +import com.nis.web.security.UserUtils; + @Controller @RequestMapping("${adminPath}/tag") @@ -26,7 +28,9 @@ public class TagController extends BaseController { model.addAttribute("selectIds", request.getParameter("selectIds")); // 指定默认选中的ID model.addAttribute("isAll", request.getParameter("isAll")); // 是否读取全部数据,不进行权限过滤 model.addAttribute("module", request.getParameter("module")); // 过滤栏目模型(仅针对CMS的Category树) - model.addAttribute("title", request.getParameter("title")); + model.addAttribute("title", request.getParameter("title"));//根节点替换文本 + model.addAttribute("enableAddBtn", request.getParameter("enableAddBtn"));//节点是否可编辑 + model.addAttribute("userId", UserUtils.getUser().getId());//如果启用了addBtn,则使用userId判断是否是用户自己创建的,用户自己创建的节点可删除 return "/sys/tagTreeselect"; } 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 b619ddb04..091e856e7 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java @@ -24,13 +24,18 @@ import com.nis.domain.configuration.AppHttpCfg; import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppPolicyCfg; import com.nis.domain.configuration.AppSslCertCfg; +import com.nis.domain.configuration.AppTcpCfg; +import com.nis.domain.configuration.AppTopicDomainCfg; 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.CodeDicUtils; import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.web.controller.BaseController; +import com.nis.web.dao.dashboard.codedic.CodeResult; import com.nis.web.security.UserUtils; /** @@ -755,6 +760,126 @@ public class AppCfgController extends BaseController { appCfgService.updateAppSslCfgValid(isValid,ids,functionId); return "redirect:" + adminPath +"/app/sslCfgList?functionId="+functionId; } + + + /** + * APP TCP会话字节数特征 列表 + * @param model + * @param cfg + * @param request + * @param response + * @return + */ + @RequestMapping(value = {"tcpCfgList"}) + public String tcpCfgList(Model model,@ModelAttribute("cfg")AppTcpCfg cfg,HttpServletRequest request,HttpServletResponse response) { + Page searchPage=new Page(request,response,"r"); + Page page = appCfgService.findAppTcpList(searchPage, cfg); + for(AppTcpCfg entity:page.getList()){ + SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); + entity.setAppName(app.getSpecServiceName()); + } + model.addAttribute("page", page); + initPageCondition(model,cfg); + return "/cfg/app/appTcpCfgList"; + } + + /** + * APP TCP会话字节数特征表单(新增/修改) + * @param model + * @param ids + * @param entity + * @return + */ + @RequestMapping(value = {"tcpCfgForm"}) + @RequiresPermissions(value={"app:tcp:config"}) + public String tcpCfgForm(Model model,String ids,AppTcpCfg entity) { + if(StringUtils.isNotBlank(ids)){ + entity = appCfgService.getAppTcpCfg(Long.parseLong(ids)); + initUpdateFormCondition(model,entity); + }else{ + initFormCondition(model,entity); + } + model.addAttribute("_cfg", entity); + return "/cfg/app/appTcpCfgForm"; + } + + /** + * APP TCP会话字节数特征配置(新增/修改)提交 + * @param model + * @param request + * @param response + * @param entity + * @param redirectAttributes + * @return + */ + @RequestMapping(value = {"saveAppTcpCfg"}) + @RequiresPermissions(value={"app:tcp:config"}) + public String saveAppTcpCfg(Model model,HttpServletRequest request,HttpServletResponse response, + AppTcpCfg entity,RedirectAttributes redirectAttributes) { + try { + SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); + if(specificService!=null){ + entity.setAppCode(specificService.getSpecServiceCode()); + } + appCfgService.saveOrUpdateAppTcpeCfg(entity); + } catch (Exception e) { + e.printStackTrace(); + addMessage(redirectAttributes, e.getMessage()); + } + + return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+entity.getFunctionId(); + } + + /** + * APP TCP会话字节数特征配置删除 + * @param isValid + * @param ids + * @param functionId + * @return + */ + @RequestMapping(value = {"updateAppTcpCfgValid"}) + @RequiresPermissions(value={"app:tcp:config"}) + public String updateAppTcpCfgValid(Integer isValid,String ids,Integer functionId) { + appCfgService.updateAppTcpCfgValid(isValid,ids,functionId); + return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+functionId; + } + + + /** + * APP TCP会话字节数特征配置 审核 + * @param isAudit + * @param isValid + * @param ids + * @param functionId + * @param redirectAttributes + * @return + */ + @RequestMapping(value = {"auditAppTcpCfg"}) + @RequiresPermissions(value={"app:tcp:confirm"}) + public String auditAppTcpCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + AppTcpCfg entity = new AppTcpCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity = appCfgService.getAppTcpCfg(Long.parseLong(id)); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); + entity.setFunctionId(functionId); + try { + appCfgService.auditAppTcpCfg(entity,isAudit); + } catch (MaatConvertException e) { + e.printStackTrace(); + logger.info("app SSL配置下发失败:"+e.getMessage()); + addMessage(redirectAttributes, e.getMessage()); + } + } + return "redirect:" + adminPath +"/app/tcpCfgList?functionId="+functionId; + } + + + + /** * APP header特征配置 列表 * @param model @@ -864,4 +989,150 @@ public class AppCfgController extends BaseController { appCfgService.updateAppHeaderCfgValid(isValid,ids,functionId); return "redirect:" + adminPath +"/app/headerCfgList?functionId="+functionId; } + + /** + * 主题网站配置列表 + * @param model + * @param cfg + * @param request + * @param response + * @return + */ + @RequestMapping(value = {"topicDomainCfgList"}) + public String TopicDomainCfgList(Model model,@ModelAttribute("cfg")AppTopicDomainCfg cfg,HttpServletRequest request,HttpServletResponse response) { + Page searchPage=new Page(request,response,"r"); + Page page = appCfgService.findAppTopicDomainList(searchPage, cfg); +// for(AppTopicDomainCfg entity:page.getList()){ +// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); +// entity.setAppName(app.getSpecServiceName()); +// } + //设置topic主题 + for (AppTopicDomainCfg entity:page.getList()) { + List codeList = CodeDicUtils.getCodeList("serviceCode"); + for (CodeResult codeResult : codeList) { + if(null!=entity.getTopic()&&codeResult.getCode().equals(entity.getTopic())){ + entity.setAppName(codeResult.getItem()); + } + } + } + model.addAttribute("page", page); + initPageCondition(model,cfg); + return "/cfg/app/appTopicDomainCfgList"; + } + /** + * app主题网站配置表单 + * @param model + * @param ids + * @param entity + * @return + */ + @RequestMapping(value = {"topicDomainCfgForm"}) + @RequiresPermissions(value={"app:topic:config"}) + public String topicDomainCfgForm(Model model,String ids,@ModelAttribute("_cfg")AppTopicDomainCfg entity) { + if(StringUtils.isNotBlank(ids)){ + entity = appCfgService.getAppTopicDomainCfg(Long.parseLong(ids)); + initUpdateFormCondition(model,entity); + }else{ + initFormCondition(model,entity); + } + model.addAttribute("_cfg", entity); + return "/cfg/app/appTopicDomainCfgForm"; + } +/** + * app主题网站配置新增修改 + * @param model + * @param request + * @param response + * @param entity + * @param redirectAttributes + * @return + */ + @RequestMapping(value = {"saveAppTopicDomainCfg"}) + @RequiresPermissions(value={"app:topic:config"}) + public String saveAppTopicDomainCfg(Model model,HttpServletRequest request,HttpServletResponse response, + AppTopicDomainCfg entity,RedirectAttributes redirectAttributes) { + try { +// SpecificServiceCfg specificService = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); +// if(specificService!=null){ +// entity.setAppCode(specificService.getSpecServiceCode()); +// } + appCfgService.saveOrUpdateAppTopicDomainCfg(entity); + addMessage(redirectAttributes,"save_success"); + } catch (Exception e) { + if(e instanceof MaatConvertException) { + e.printStackTrace(); + logger.info("app主题网站配置下发失败:"+e.getMessage());; + addMessage(redirectAttributes,"request_service_failed"); + }else { + e.printStackTrace(); + logger.error("app主题网站配置下发失败",e); + addMessage(redirectAttributes,"save_failed"); + } + } + + return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+entity.getFunctionId(); + } + /** + * domain配置审核 + * @param isAudit + * @param isValid + * @param ids + * @param functionId + * @param redirectAttributes + * @return + */ + @RequestMapping(value = {"auditAppTopicDomainCfg"}) +// @RequiresPermissions(value={"app:domain:confirm"}) + public String auditAppTopicDomainCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + AppTopicDomainCfg entity = new AppTopicDomainCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity = appCfgService.getAppTopicDomainCfg(Long.parseLong(id)); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); + entity.setFunctionId(functionId); + try { + appCfgService.auditAppTopicDomainCfg(entity,isAudit); + addMessage(redirectAttributes,"audit_success"); + } catch (MaatConvertException e) { + if(e instanceof MaatConvertException) { + e.printStackTrace(); + logger.info("app主题网站配置下发失败:"+e.getMessage());; + addMessage(redirectAttributes,"request_service_failed"); + }else { + e.printStackTrace(); + logger.error("app主题网站配置下发失败",e); + addMessage(redirectAttributes,"audit_failed"); + } + } + } + return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+functionId; + } + /** + * 网站主题配置删除 + * @param isValid + * @param ids + * @param functionId + * @return + */ + @RequestMapping(value = {"updateAppTopicDomainCfgValid"}) + @RequiresPermissions(value={"app:topic:config"}) + public String updateAppTopicDomainCfgValid(Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) { + try { + appCfgService.updateAppTopicDomainCfgValid(isValid,ids,functionId); + addMessage(redirectAttributes,"delete_success"); + } catch (Exception e) { + logger.error("app主题网站删除失败",e); + if(e instanceof MaatConvertException||e instanceof CallExternalProceduresException) { + e.printStackTrace(); + addMessage(redirectAttributes,"request_service_failed"); + }else { + e.printStackTrace(); + addMessage(redirectAttributes,"delete_failed"); + } + } + return "redirect:" + adminPath +"/app/topicDomainCfgList?functionId="+functionId; + } } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java index 491dff836..42e621c49 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/FileTransferCfgController.java @@ -225,7 +225,7 @@ public class FileTransferCfgController extends BaseController{ entity.setCreateTime(date); fileTime=entity.getCreateTime(); } - ToMaatResult result = null; + ToMaatResult result = new ToMaatResult(); if(file!=null && file.getSize()>0 && entity!=null){ String sep = System.getProperty("file.separator"); String digestFilePath = request.getRealPath("/")+"digestFile"; @@ -245,6 +245,10 @@ public class FileTransferCfgController extends BaseController{ String md5 = DigestUtils.md5Hex(file.getBytes()); fileMap.put("checksum", md5); result = ConfigServiceUtil.getFileDigest(null, uploadFile, JsonMapper.toJsonString(fileMap)); + if((result.getData().getRawLen() == null) || (result.getData().getDigest() == null)) { + logger.info("文件摘要信息获取有误!"); + throw new MaatConvertException(":"+null); + } logger.info("获取文件摘要响应信息:"+result); } fileTransferCfgService.saveOrUpdateFileDigestCfg(entity,result,areaCfgIds); @@ -282,6 +286,25 @@ public class FileTransferCfgController extends BaseController{ } return "redirect:" + adminPath +"/ntc/fileTransfer/fileDigestList?functionId="+functionId; } + @RequestMapping(value = {"ajaxFileDigestSubIdList"}) + public String ajaxFileDigestSubIdList(Model model,Long cfgId,Integer index) { + FileDigestCfg cfg = fileTransferCfgService.getFileDigestSubIdCfg(cfgId); + List tabList = new ArrayList(); + //查询SubscribeId域配置 + 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/fileTransfer/fileDigestSubList"; + } @RequestMapping(value = {"p2pList"}) public String p2pList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { 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/controller/specific/SpecificServiceCfgController.java b/src/main/java/com/nis/web/controller/specific/SpecificServiceCfgController.java index 7d1d980a3..4335b9050 100644 --- a/src/main/java/com/nis/web/controller/specific/SpecificServiceCfgController.java +++ b/src/main/java/com/nis/web/controller/specific/SpecificServiceCfgController.java @@ -1,6 +1,5 @@ package com.nis.web.controller.specific; -import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Properties; @@ -13,6 +12,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.mvc.support.RedirectAttributes; @@ -22,6 +22,8 @@ import com.google.common.collect.Maps; import com.nis.domain.Page; import com.nis.domain.SysDataDictionaryItem; import com.nis.domain.specific.SpecificServiceCfg; +import com.nis.exceptions.MaatConvertException; +import com.nis.util.Constants; import com.nis.util.DictUtils; import com.nis.util.StringUtils; import com.nis.web.controller.BaseController; @@ -201,8 +203,9 @@ public class SpecificServiceCfgController extends BaseController { Map map2 = Maps.newHashMap(); map2.put("id", 0); map2.put("pId", 0); - map2.put("type",0); + map2.put("serviceType",0); map2.put("business",-2); + map2.put("groupId",0); map2.put("name","root_node"); //map2.put("placeholder","0"); mapList.add(map2); @@ -222,6 +225,7 @@ public class SpecificServiceCfgController extends BaseController { map.put("name",props.getProperty(dict.getItemValue(), dict.getItemValue())); map.put("serviceType",cfgType); map.put("businessType","-1"); + map.put("groupId",0); businessList.add(map); } mapList.addAll(businessList); @@ -242,7 +246,12 @@ public class SpecificServiceCfgController extends BaseController { map.put("pId", "businessType"+business.getItemCode()); map.put("name",specificServiceCfg.getSpecServiceName()); map.put("serviceType",specificServiceCfg.getCfgType()); + map.put("serviceCode",specificServiceCfg.getSpecServiceCode()); map.put("businessType",specificServiceCfg.getBusinessType()); + map.put("groupId",specificServiceCfg.getGroupId()); + if(specificServiceCfg.getAddFlag()!=null) { + map.put("user",specificServiceCfg.getAddFlag()); + } mapList.add(map); break; } @@ -253,6 +262,7 @@ public class SpecificServiceCfgController extends BaseController { map.put("pId", specificServiceCfg.getParent().getSpecServiceId()); map.put("name",specificServiceCfg.getSpecServiceName()); map.put("serviceType",specificServiceCfg.getCfgType()); + map.put("groupId",specificServiceCfg.getGroupId()); mapList.add(map); } } @@ -272,6 +282,10 @@ public class SpecificServiceCfgController extends BaseController { map.put("pId", specificServiceCfg.getParent().getSpecServiceId()); map.put("name",specificServiceCfg.getSpecServiceName()); map.put("type",specificServiceCfg.getCfgType()); + map.put("groupId",specificServiceCfg.getGroupId()); + if(specificServiceCfg.getAddFlag()!=null) { + map.put("user",specificServiceCfg.getAddFlag()); + } mapList.add(map); } } @@ -380,5 +394,70 @@ public class SpecificServiceCfgController extends BaseController { } return false; } + @ResponseBody + @RequestMapping(value = "ajaxSaveOrUpdateApp",method=RequestMethod.POST ) + public Map ajaxSaveOrUpdateApp(@RequestParam(required=true,value="specServiceId")String specServiceId,@RequestParam(required=false,value="specServiceCode")String specServiceCode,@RequestParam(required=true,value="specServiceName") String specServiceName, + @RequestParam(required=true,value="cfgType") String cfgType, @RequestParam(required=true,value="businessType")String businessType,@RequestParam(required=false,value="addFlag")String addFlag, + @RequestParam(required=false,value="groupId")String groupId){ + Map map = Maps.newHashMap(); + //校验是真ID还是假ID,假的Id以manual开头无法转换成数字 + boolean isTrueId=false; + try { + Long.parseLong(specServiceId); + isTrueId=true; + }catch (Exception e) { + // TODO: handle exception + } + try{ + SpecificServiceCfg cfg=new SpecificServiceCfg(); + if(isTrueId) { + cfg.setSpecServiceId(Integer.parseInt(specServiceId)); + } + if(StringUtils.isNotBlank(specServiceCode)) { + cfg.setSpecServiceCode(Integer.parseInt(specServiceCode)); + } + cfg.setAddFlag(Integer.parseInt(addFlag)); + cfg.setSpecServiceName(specServiceName); + cfg.setBusinessType(businessType); + cfg.setCfgType(Integer.parseInt(cfgType)); + cfg.setIsValid(Constants.VALID_YES); + if(StringUtils.isNotBlank(groupId)) { + cfg.setGroupId(Integer.parseInt(groupId)); + } + + SpecificServiceCfg parent=new SpecificServiceCfg(); + parent.setSpecServiceId(0); + cfg.setParent(parent); + specificServiceCfgService.saveOrUpdate(cfg); + cfg=specificServiceCfgService.getBySpecServiceId(cfg.getSpecServiceId()); + map.put("id", cfg.getSpecServiceId()); + map.put("pId", "businessType"+cfg.getBusinessType()); + map.put("name",cfg.getSpecServiceName()); + map.put("serviceType",cfg.getCfgType()); + map.put("businessType",cfg.getBusinessType()); + map.put("groupId",cfg.getGroupId()); + return map; + }catch (Exception e) { + e.printStackTrace(); + if(e instanceof MaatConvertException) { + map.put("errTip", "request_service_failed"); + }else { + map.put("errTip", "save_failed"); + } + } + + return map; + } + @ResponseBody + @RequestMapping(value = "ajaxRemoveApp",method=RequestMethod.POST ) + public boolean ajaxRemoveApp(@RequestParam(required=true,value="specServiceId")Integer specServiceId){ + try{ + specificServiceCfgService.delete(String.valueOf(specServiceId)); + return true; + }catch (Exception e) { + e.printStackTrace(); + } + return false; + } } diff --git a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java index 7c15dd79b..26307a96e 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java @@ -17,6 +17,8 @@ import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppPolicyCfg; import com.nis.domain.configuration.AppSslCertCfg; import com.nis.domain.configuration.AppStringCfg; +import com.nis.domain.configuration.AppTcpCfg; +import com.nis.domain.configuration.AppTopicDomainCfg; import com.nis.domain.configuration.BaseCfg; import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.ComplexkeywordCfg; @@ -57,6 +59,11 @@ public interface AppCfgDao { public AppDomainCfg getAppDomainCfg(Long cfgId) ; public int insertAppDomainCfg(AppDomainCfg entity); public int updateAppDomainCfg(AppDomainCfg entity); + //app 主题网站配置增删改查 + public List findAppTopicDomainList(AppTopicDomainCfg entity) ; + public AppTopicDomainCfg getAppTopicDomainCfg(Long cfgId) ; + public int insertAppTopicDomainCfg(AppTopicDomainCfg entity); + public int updateAppTopicDomainCfg(AppTopicDomainCfg entity); //app 字节特征增删改查 public List findAppByteList(AppByteCfg entity) ; public AppByteCfg getAppByteCfg(Long cfgId) ; @@ -77,7 +84,11 @@ public interface AppCfgDao { public AppHeaderCfg getAppHeaderCfg(Long cfgId); public int insertAppHeaderCfg(AppHeaderCfg entity); public int updateAppHeaderCfg(AppHeaderCfg entity); - + //APP TCP会话字节数特征 + public List findAppTcpList(AppTcpCfg entity); + public AppTcpCfg getAppTcpCfg(Long cfgId); + public int insertAppTcpCfg(AppTcpCfg entity); + public int updateAppTcpCfg(AppTcpCfg entity); //审核配置 public void auditCfg(BaseCfg entity); //修改配置状态 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 94696fa3d..50a01fff6 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml @@ -137,6 +137,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -297,6 +328,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT, + 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.low_boundary,r.up_boundary as upBoundary,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.do_log + + r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT, @@ -332,6 +404,14 @@ r.DOMAIN,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.DO_LOG + + r.CFG_ID, r.TOPIC,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT, + 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.DOMAIN,r.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.DO_LOG + + r.CFG_ID, r.APP_CODE,r.BEHAV_CODE,r.SPEC_SERVICE_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT, r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME, @@ -358,6 +438,17 @@ #{areaEffectiveIds,jdbcType=VARCHAR},#{ratelimit,jdbcType=INTEGER},#{functionId,jdbcType=INTEGER}, #{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER} + + #{topic,jdbcType=VARCHAR},#{behavCode,jdbcType=INTEGER},#{specServiceId,jdbcType=INTEGER}, + #{cfgDesc,jdbcType=VARCHAR},#{action,jdbcType=INTEGER}, + #{isValid,jdbcType=INTEGER},#{isAudit,jdbcType=INTEGER},#{creatorId,jdbcType=INTEGER}, + #{createTime,jdbcType=TIMESTAMP},#{editorId,jdbcType=INTEGER},#{editTime,jdbcType=TIMESTAMP}, + #{auditorId,jdbcType=INTEGER},#{auditTime,jdbcType=TIMESTAMP},#{serviceId,jdbcType=INTEGER}, + #{requestId,jdbcType=INTEGER},#{compileId,jdbcType=INTEGER},#{isAreaEffective,jdbcType=INTEGER}, + #{classify,jdbcType=VARCHAR},#{attribute,jdbcType=VARCHAR},#{lable,jdbcType=VARCHAR}, + #{areaEffectiveIds,jdbcType=VARCHAR},#{ratelimit,jdbcType=INTEGER},#{functionId,jdbcType=INTEGER}, + #{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER} + a.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port @@ -438,6 +529,13 @@ FROM app_domain_cfg r WHERE CFG_ID = #{cfgId,jdbcType=BIGINT} + + + + + + + + + + SELECT LAST_INSERT_ID() + + insert into app_session_cfg ( + APP_CODE,BEHAV_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT, + 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, + low_boundary,up_boundary,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG + )values ( + , + #{lowBoundary,jdbcType=INTEGER},#{upBoundary,jdbcType=INTEGER}, + #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER} + ) + SELECT LAST_INSERT_ID() @@ -1330,7 +1672,7 @@ , #{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER},#{isHexbin,jdbcType=INTEGER} ,#{userRegion1,jdbcType=VARCHAR} ,#{userRegion2,jdbcType=VARCHAR} ,#{userRegion3,jdbcType=VARCHAR} - ,#{userRegion4,jdbcType=VARCHAR} ,#{userRegion5,jdbcType=VARCHAR} + ,#{userRegion4,jdbcType=VARCHAR} ,#{userRegion5,jdbcType=VARCHAR} ,#{doLog,jdbcType=INTEGER} ) @@ -1383,6 +1725,23 @@ #{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER} ) + + + + SELECT LAST_INSERT_ID() + + insert into app_topic_domain_cfg ( + TOPIC,BEHAV_CODE,SPEC_SERVICE_ID,CFG_DESC,ACTION,IS_VALID,IS_AUDIT, + 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, + DOMAIN,EXPR_TYPE,MATCH_METHOD,IS_HEXBIN,DO_LOG + )values ( + , + #{domain,jdbcType=VARCHAR},#{exprType,jdbcType=INTEGER},#{matchMethod,jdbcType=INTEGER}, + #{isHexbin,jdbcType=INTEGER},#{doLog,jdbcType=INTEGER} + ) + SELECT LAST_INSERT_ID() @@ -1933,6 +2292,106 @@ where cfg_id = #{cfgId,jdbcType=BIGINT} + + + update app_topic_domain_cfg + + + + cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, + + + TOPIC = #{topic,jdbcType=VARCHAR}, + + + BEHAV_CODE = #{behavCode,jdbcType=INTEGER}, + + + SPEC_SERVICE_ID = #{specServiceId,jdbcType=INTEGER}, + + + action = #{action,jdbcType=INTEGER}, + + + is_valid = #{isValid,jdbcType=INTEGER}, + + + is_audit = #{isAudit,jdbcType=INTEGER}, + + + creator_id = #{creatorId,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + editor_id = #{editorId,jdbcType=INTEGER}, + + + edit_time = #{editTime,jdbcType=TIMESTAMP}, + + + auditor_id = #{auditorId,jdbcType=INTEGER}, + + + audit_time = #{auditTime,jdbcType=TIMESTAMP}, + + + service_id = #{serviceId,jdbcType=INTEGER}, + + + request_id = #{requestId,jdbcType=INTEGER}, + + + compile_id = #{compileId,jdbcType=INTEGER}, + + + is_area_effective = #{isAreaEffective,jdbcType=INTEGER}, + + + classify = #{classify,jdbcType=VARCHAR}, + + + attribute = #{attribute,jdbcType=VARCHAR}, + + + lable = #{lable,jdbcType=VARCHAR}, + + + area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}, + + + function_id = #{functionId,jdbcType=INTEGER}, + + + RATELIMIT=#{ratelimit,jdbcType=INTEGER}, + + + CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}, + + + CFG_TYPE =#{cfgType,jdbcType=VARCHAR}, + + + domain=#{domain,jdbcType=VARCHAR}, + + + expr_type=#{exprType,jdbcType=INTEGER}, + + + match_method=#{matchMethod,jdbcType=INTEGER}, + + + is_hexbin=#{isHexbin,jdbcType=INTEGER}, + + + + + where cfg_id = #{cfgId,jdbcType=BIGINT} + + update app_byte_cfg @@ -2267,6 +2726,108 @@ + + update app_session_cfg + + + + cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, + + + APP_CODE = #{appCode,jdbcType=INTEGER}, + + + BEHAV_CODE = #{behavCode,jdbcType=INTEGER}, + + + SPEC_SERVICE_ID = #{specServiceId,jdbcType=INTEGER}, + + + action = #{action,jdbcType=INTEGER}, + + + is_valid = #{isValid,jdbcType=INTEGER}, + + + is_audit = #{isAudit,jdbcType=INTEGER}, + + + creator_id = #{creatorId,jdbcType=INTEGER}, + + + create_time = #{createTime,jdbcType=TIMESTAMP}, + + + editor_id = #{editorId,jdbcType=INTEGER}, + + + edit_time = #{editTime,jdbcType=TIMESTAMP}, + + + auditor_id = #{auditorId,jdbcType=INTEGER}, + + + audit_time = #{auditTime,jdbcType=TIMESTAMP}, + + + service_id = #{serviceId,jdbcType=INTEGER}, + + + request_id = #{requestId,jdbcType=INTEGER}, + + + compile_id = #{compileId,jdbcType=INTEGER}, + + + is_area_effective = #{isAreaEffective,jdbcType=INTEGER}, + + + classify = #{classify,jdbcType=VARCHAR}, + + + attribute = #{attribute,jdbcType=VARCHAR}, + + + lable = #{lable,jdbcType=VARCHAR}, + + + area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}, + + + function_id = #{functionId,jdbcType=INTEGER}, + + + RATELIMIT=#{ratelimit,jdbcType=INTEGER}, + + + CFG_REGION_CODE=#{cfgRegionCode,jdbcType=INTEGER}, + + + CFG_TYPE =#{cfgType,jdbcType=VARCHAR}, + + + low_boundary=#{lowBoundary,jdbcType=INTEGER}, + + + up_boundary=#{upBoundary,jdbcType=INTEGER}, + + + expr_type=#{exprType,jdbcType=INTEGER}, + + + match_method=#{matchMethod,jdbcType=INTEGER}, + + + is_hexbin=#{isHexbin,jdbcType=INTEGER}, + + + do_log=#{doLog,jdbcType=INTEGER}, + + + + where cfg_id = #{cfgId,jdbcType=BIGINT} + + delete from ip_port_cfg where compile_id=#{compileId} and function_id=#{functionId} diff --git a/src/main/java/com/nis/web/dao/configuration/BgpCfgDao.java b/src/main/java/com/nis/web/dao/configuration/BgpCfgDao.java index 83a5eb280..15f6853be 100644 --- a/src/main/java/com/nis/web/dao/configuration/BgpCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/BgpCfgDao.java @@ -41,6 +41,7 @@ public interface BgpCfgDao extends CrudDao{ public void saveIpPortCfg(IpPortCfg entity); public void updateBgpAsCfg(CfgIndexInfo entity); public void updateSubscribeIdCfg(CfgIndexInfo entity); + public void deleteSubscribeIdCfg(CfgIndexInfo entity); //public void saveHttpUrlCfg(HttpUrlCfg entity); public void deleteHttpIpCfg(CfgIndexInfo entity); //public void deleteHttpUrlCfg(CfgIndexInfo entity); diff --git a/src/main/java/com/nis/web/dao/configuration/BgpCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/BgpCfgDao.xml index be0035cba..2553b3695 100644 --- a/src/main/java/com/nis/web/dao/configuration/BgpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/BgpCfgDao.xml @@ -639,6 +639,10 @@ delete from ntc_bgp_as_cfg where compile_id=#{compileId} and function_id=#{functionId} + + delete from ntc_subscribe_id_cfg where compile_id=#{compileId} and function_id=#{functionId} + + update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , diff --git a/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.java b/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.java index e43bc8ca3..297a8b4e7 100644 --- a/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.java @@ -38,6 +38,8 @@ public interface FileTransferCfgDao extends CrudDao { public void auditCfg(BaseCfg entity); public FileDigestCfg getFileDigest(Long id); public void updateFileDigestCfg(FileDigestCfg entity); + public void deleteFileDigestSubscribeIdCfg(FileDigestCfg entity); + public List getFileDigestSubscribeidList(FileDigestCfg entity); // P2P域配置新增 public void saveP2pHashCfg(BaseStringCfg cfg); @@ -53,4 +55,5 @@ public interface FileTransferCfgDao extends CrudDao { public void deleteP2pHashCfg(CfgIndexInfo entity); public void deleteP2pKeywordCfg(CfgIndexInfo entity); public void deleteP2pSubscribeIdCfg(CfgIndexInfo entity); + } diff --git a/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.xml index 9140f8307..21f48b1cb 100644 --- a/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.xml @@ -1051,11 +1051,14 @@ delete from p2p_keyword_cfg where compile_id=#{compileId} and function_id=#{functionId} - + delete from ntc_subscribe_id_cfg where compile_id=#{compileId} and function_id=#{functionId} - + + + delete from ntc_subscribe_id_cfg where compile_id=#{compileId} and function_id=#{functionId} + + + update file_digest_cfg 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/dao/specific/SpecificServiceCfgDao.java b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.java index 2360e1d46..44d828b53 100644 --- a/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.java +++ b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.java @@ -50,5 +50,6 @@ public interface SpecificServiceCfgDao extends CrudDao { Integer getParentType(Integer specServiceId); Integer getParentCode(Integer specServiceId); SpecificServiceCfg getRepeat(@Param("specServiceCode")Integer code, @Param("cfgType")Integer cfgType,@Param("parentId")Integer parentId); + Integer getMaxServiceCode(@Param("maxCode")Integer code, @Param("cfgType")Integer cfgType,@Param("addFlag")Integer addFlag); } \ No newline at end of file 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 f24e7ac07..782502ca3 100644 --- a/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml +++ b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml @@ -12,6 +12,7 @@ + @@ -30,7 +31,8 @@ s.is_leaf AS isLeaf, s.group_id AS groupId, s.cfg_type AS cfgType, - s.business_type AS businessType + s.business_type AS businessType, + s.add_flag AS addFlag @@ -152,6 +154,9 @@ AND op_time < #{specificServiceCfg.endDate} + + AND add_flag = #{specificServiceCfg.addFlag} + ORDER BY ${orderBy} @@ -161,11 +166,23 @@ - + - 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,business_type) - values(#{specServiceCode},#{specServiceName},#{specServiceDesc},#{isValid},#{opTime},#{parent.specServiceId},#{isLeaf},#{groupId},#{cfgType},#{businessType}) + + SELECT LAST_INSERT_ID() + + 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,business_type,add_flag) + values(#{specServiceCode},#{specServiceName},#{specServiceDesc},#{isValid},#{opTime},#{parent.specServiceId},#{isLeaf},#{groupId},#{cfgType}, + #{businessType},#{addFlag}) diff --git a/src/main/java/com/nis/web/service/configuration/AppCfgService.java b/src/main/java/com/nis/web/service/configuration/AppCfgService.java index 1e5902067..0388674ea 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -18,6 +18,8 @@ import com.nis.domain.configuration.AppHttpCfg; import com.nis.domain.configuration.AppIpCfg; import com.nis.domain.configuration.AppPolicyCfg; import com.nis.domain.configuration.AppSslCertCfg; +import com.nis.domain.configuration.AppTcpCfg; +import com.nis.domain.configuration.AppTopicDomainCfg; import com.nis.domain.configuration.AreaIpCfg; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.NtcSubscribeIdCfg; @@ -85,6 +87,14 @@ public class AppCfgService extends BaseService { page.setList(list); return page; } + //主题网站列表 + public Page findAppTopicDomainList(Page page, AppTopicDomainCfg entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r")); + entity.setPage(page); + List list = appCfgDao.findAppTopicDomainList(entity); + page.setList(list); + return page; + } public Page findAppByteList(Page page, AppByteCfg entity) { entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r")); entity.setPage(page); @@ -99,6 +109,21 @@ public class AppCfgService extends BaseService { page.setList(list); return page; } + + + public Page findAppTcpList(Page page, AppTcpCfg entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r")); + entity.setPage(page); + List list = appCfgDao.findAppTcpList(entity); + page.setList(list); + return page; + } + + public AppTcpCfg getAppTcpCfg(Long cfgId){ + return appCfgDao.getAppTcpCfg(cfgId); + } + + public AppPolicyCfg getAppPolicyCfg(Long cfgId){ AppPolicyCfg policy = appCfgDao.getAppPolicyCfg(cfgId); List ipPortList = appCfgDao.getAppPolicyIpList(policy); @@ -122,6 +147,10 @@ public class AppCfgService extends BaseService { public AppDomainCfg getAppDomainCfg(Long cfgId){ return appCfgDao.getAppDomainCfg(cfgId); } + //主题网站form + public AppTopicDomainCfg getAppTopicDomainCfg(Long cfgId){ + return appCfgDao.getAppTopicDomainCfg(cfgId); + } public AppByteCfg getAppByteCfg(Long cfgId){ return appCfgDao.getAppByteCfg(cfgId); } @@ -209,7 +238,7 @@ public class AppCfgService extends BaseService { for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ entity.setCfgKeywords(cfg.getCfgKeywords()); - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType","exprType","matchMethod","isHexbin"}); stringcfgDao.saveSubscribeIdCfg(cfg); } } @@ -397,6 +426,62 @@ public class AppCfgService extends BaseService { } } } + //主题网站新增 修改 + public void saveOrUpdateAppTopicDomainCfg(AppTopicDomainCfg entity) throws Exception{ + //设置区域运营商信息 + setAreaEffectiveIds(entity); + + if(entity.getCfgId()==null){ + Integer compileId = 0; + try { + List idList = ConfigServiceUtil.getId(1, 1); + if(idList!=null && idList.size()>0){ + compileId = idList.get(0); + } + entity.setCompileId(compileId); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + entity.setIsValid(0); + entity.setIsAudit(0); + appCfgDao.insertAppTopicDomainCfg(entity); + //保存区域IP信息 + if(entity.getAreaCfg()!=null){ + for(AreaIpCfg cfg:entity.getAreaCfg()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } + } + }catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(e.getMessage()); + } + }else{ + entity.setEditorId(entity.getCurrentUser().getId()); + entity.setEditTime(new Date()); + entity.setIsValid(0); + entity.setIsAudit(0); + appCfgDao.updateAppTopicDomainCfg(entity); + //删除旧的区域IP,新增新的区域IP + AreaIpCfg area = new AreaIpCfg(); + area.setCompileId(entity.getCompileId()); + area.setFunctionId(entity.getFunctionId()); + areaIpCfgDao.deleteAreaIpCfg(area); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + //保存区域IP信息 + if(entity.getAreaCfg()!=null){ + for(AreaIpCfg cfg:entity.getAreaCfg()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } + } + } + } + + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void saveOrUpdateAppByteCfg(AppByteCfg entity) throws Exception{ //设置区域运营商信息 @@ -508,6 +593,142 @@ public class AppCfgService extends BaseService { } + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void saveOrUpdateAppTcpeCfg(AppTcpCfg entity) throws Exception{ + //设置区域运营商信息 + setAreaEffectiveIds(entity); + if(entity.getCfgId()==null){ + Integer compileId = 0; + try { + List idList = ConfigServiceUtil.getId(1, 1); + if(idList!=null && idList.size()>0){ + compileId = idList.get(0); + } + entity.setCompileId(compileId); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + entity.setIsValid(0); + entity.setIsAudit(0); + appCfgDao.insertAppTcpCfg(entity); + //保存区域IP信息 + if(entity.getAreaCfg()!=null){ + for(AreaIpCfg cfg:entity.getAreaCfg()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } + } + }catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(e.getMessage()); + } + }else{ + entity.setEditorId(entity.getCurrentUser().getId()); + entity.setEditTime(new Date()); + entity.setIsValid(0); + entity.setIsAudit(0); + appCfgDao.updateAppTcpCfg(entity); + //删除旧的区域IP,新增新的区域IP + AreaIpCfg area = new AreaIpCfg(); + area.setCompileId(entity.getCompileId()); + area.setFunctionId(entity.getFunctionId()); + areaIpCfgDao.deleteAreaIpCfg(area); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + //保存区域IP信息 + if(entity.getAreaCfg()!=null){ + for(AreaIpCfg cfg:entity.getAreaCfg()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } + } + } + } + + public void auditAppTcpCfg(AppTcpCfg entity,Integer isAudit){ + ToMaatBean maatBean = new ToMaatBean(); + MaatCfg maatCfg = new MaatCfg(); + List configCompileList = new ArrayList(); + List groupRelationList = new ArrayList(); + List ipRegionList = new ArrayList(); + List strRegionList = new ArrayList(); + List numRegionList = new ArrayList(); + List digestRegionList = new ArrayList(); + List areaIpRegionList = new ArrayList(); + entity.setTableName(AppTcpCfg.getTablename()); + appCfgDao.auditCfg(entity); + + if(isAudit==1){ + List list = new ArrayList(); + list.add(entity); + Map map = cfgConvert(numRegionList,list,4,entity,groupRelationList); + groupRelationList=map.get("groupList"); + numRegionList=map.get("dstList"); + } + /* //保存区域IP信息 + List areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); + if(!StringUtil.isEmpty(areaIpCfgList)){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + appCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(areaIpRegionList,areaIpCfgList,4,entity,groupRelationList); + groupRelationList=map.get("groupList"); + areaIpRegionList=map.get("dstList"); + } + }*/ + //构造提交综合服务参数格式,一条配置提交一次综合服务 + if(isAudit==1){ + maatCfg.initDefaultValue(); + BeanUtils.copyProperties(entity, maatCfg); + maatCfg.setAction(entity.getAction()); + maatCfg.setAuditTime(entity.getAuditTime()); + maatCfg.setIpRegionList(ipRegionList); + maatCfg.setStrRegionList(strRegionList); + maatCfg.setNumRegionList(numRegionList); + maatCfg.setDigestRegionList(digestRegionList); + maatCfg.setGroupRelationList(groupRelationList); + maatCfg.setGroupNum(groupRelationList.size()); + maatCfg.setAreaIpRegionList(areaIpRegionList); + maatCfg.setIsValid(entity.getIsValid()); + //设置APP自定义域 + String userRegion = "APP_ID="+entity.getAppCode(); + maatCfg.setUserRegion(userRegion); + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.INSERT_ACTION); + //调用服务接口下发配置数据 + String json=gsonToJson(maatBean); + logger.info("app SSL配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + logger.info("app TCP配置下发响应信息:"+result.getMsg()); + + }else if(isAudit==3){ + maatCfg.setCompileId(entity.getCompileId()); + maatCfg.setServiceId(entity.getServiceId()); + maatCfg.setIsValid(0);//无效 + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.UPDATE_ACTION); + //调用服务接口取消配置 + String json=gsonToJson(maatBean); + logger.info("app TCP配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.put(json,1); + logger.info("app TCP配置取消配置响应信息:"+result.getMsg()); + } + } + public void auditAppPolicyCfg(AppPolicyCfg entity,Integer isAudit){ String configType=entity.getConfigType(); ToMaatBean maatBean = new ToMaatBean(); @@ -910,6 +1131,98 @@ public class AppCfgService extends BaseService { logger.info("app域名配置取消配置响应信息:"+result.getMsg()); } } + + //app主题网站配置审核 + public void auditAppTopicDomainCfg(AppTopicDomainCfg entity,Integer isAudit){ + ToMaatBean maatBean = new ToMaatBean(); + MaatCfg maatCfg = new MaatCfg(); + List configCompileList = new ArrayList(); + List groupRelationList = new ArrayList(); + List ipRegionList = new ArrayList(); + List strRegionList = new ArrayList(); + List numRegionList = new ArrayList(); + List digestRegionList = new ArrayList(); + List areaIpRegionList = new ArrayList(); + entity.setTableName(AppTopicDomainCfg.getTablename()); + appCfgDao.auditCfg(entity); + //域名为关键字 + if(isAudit==1){ + entity.setCfgKeywords(entity.getDomain()); + List list = new ArrayList(); + list.add(entity); + Map map = cfgConvert(strRegionList,list,2,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + //保存区域IP信息 + List areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); + if(!StringUtil.isEmpty(areaIpCfgList)){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + appCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList); + groupRelationList=map.get("groupList"); + areaIpRegionList=map.get("dstList"); + } + } + //构造提交综合服务参数格式,一条配置提交一次综合服务 + if(isAudit==1){ + maatCfg.initDefaultValue(); + BeanUtils.copyProperties(entity, maatCfg); + maatCfg.setAction(entity.getAction()); + maatCfg.setAuditTime(entity.getAuditTime()); + maatCfg.setIpRegionList(ipRegionList); + maatCfg.setStrRegionList(strRegionList); + maatCfg.setNumRegionList(numRegionList); + maatCfg.setDigestRegionList(digestRegionList); + maatCfg.setGroupRelationList(groupRelationList); + maatCfg.setGroupNum(groupRelationList.size()); + maatCfg.setAreaIpRegionList(areaIpRegionList); + maatCfg.setIsValid(entity.getIsValid()); + + //设置APP自定义域 +// "APP_ID="+entity.getAppCode()+Constants.USER_REGION_SPLIT+ + String userRegion = "DOMAIN_ID="+entity.getCompileId()+Constants.USER_REGION_SPLIT+ + "DOMAIN_STR="+keywordsEscape(entity.getDomain()); + + maatCfg.setUserRegion(userRegion); + + + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.INSERT_ACTION); + //调用服务接口下发配置数据 + String json=gsonToJson(maatBean); + logger.info("app主题网站配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + logger.info("app主题网站配置下发响应信息:"+result.getMsg()); + + }else if(isAudit==3){ + maatCfg.setCompileId(entity.getCompileId()); + maatCfg.setServiceId(entity.getServiceId()); + maatCfg.setIsValid(0);//无效 + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(Constants.UPDATE_ACTION); + //调用服务接口取消配置 + String json=gsonToJson(maatBean); + logger.info("app主题网站配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.put(json,1); + logger.info("app主题网站配置取消配置响应信息:"+result.getMsg()); + } + } + + public void auditAppByteCfg(AppByteCfg entity,Integer isAudit){ ToMaatBean maatBean = new ToMaatBean(); MaatCfg maatCfg = new MaatCfg(); @@ -1097,7 +1410,7 @@ public class AppCfgService extends BaseService { if(entity.getNtcSubscribeIdCfgList()!=null&&entity.getNtcSubscribeIdCfgList().size()>0){ NtcSubscribeIdCfg ntcSubscribeIdCfg = new NtcSubscribeIdCfg(); BeanUtils.copyProperties(entity, ntcSubscribeIdCfg, new String[]{"cfgId"}); - stringcfgDao.deleteSubscribeIdCfg(ntcSubscribeIdCfg); + stringcfgDao.updateSubscribeIdCfg(ntcSubscribeIdCfg); } //保存区域IP信息 if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ @@ -1132,6 +1445,30 @@ public class AppCfgService extends BaseService { } } + + public void updateAppTcpCfgValid(Integer isValid,String ids,Integer functionId){ + AppTcpCfg entity = new AppTcpCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity.setCfgId(Long.parseLong(id)); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + entity.setTableName(AppTcpCfg.getTablename()); + entity.setFunctionId(functionId); + appCfgDao.updateCfgValid(entity); + //保存区域IP信息 + if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + appCfgDao.updateCfgValid(cfg); + } + + } + + } + public void updateAppHttpCfgValid(Integer isValid,String ids,Integer functionId){ AppHttpCfg entity = new AppHttpCfg(); String[] idArray = ids.split(","); @@ -1176,6 +1513,30 @@ public class AppCfgService extends BaseService { } } + //主题网站配置删除 + public void updateAppTopicDomainCfgValid(Integer isValid,String ids,Integer functionId){ + AppTopicDomainCfg entity = new AppTopicDomainCfg(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity.setCfgId(Long.parseLong(id)); + entity.setIsValid(isValid); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(new Date()); + entity.setTableName(AppTopicDomainCfg.getTablename()); + entity.setFunctionId(functionId); + appCfgDao.updateCfgValid(entity); + //保存区域IP信息 + if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + appCfgDao.updateCfgValid(cfg); + } + + } + + } + public void updateAppByteCfgValid(Integer isValid,String ids,Integer functionId){ AppByteCfg entity = new AppByteCfg(); String[] idArray = ids.split(","); diff --git a/src/main/java/com/nis/web/service/configuration/BgpCfgService.java b/src/main/java/com/nis/web/service/configuration/BgpCfgService.java index ba5fd87f8..43820e5f7 100644 --- a/src/main/java/com/nis/web/service/configuration/BgpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/BgpCfgService.java @@ -135,10 +135,10 @@ public class BgpCfgService extends CrudService { areaIpCfgDao.saveAreaIpCfg(cfg); } } - } catch (Exception e) { + } catch (MaatConvertException e) { e.printStackTrace(); logger.info("获取编译ID出错"); - throw new MaatConvertException(":"+e.getMessage()); + throw new MaatConvertException(""); } }else{ @@ -146,9 +146,7 @@ public class BgpCfgService extends CrudService { //无效子配置后,再新增子配置 bgpCfgDao.deleteIpCfg(entity); bgpCfgDao.deleteBgpAsCfg(entity); - if(entity.getNtcSubscribeIdCfg()!=null){ - stringCfgDao.deleteSubscribeIdCfg(entity.getNtcSubscribeIdCfg()); - } + bgpCfgDao.deleteSubscribeIdCfg(entity); //TODO //bgpCfgDao.deleteDnsDomainCfg(entity); AreaIpCfg area = new AreaIpCfg(); diff --git a/src/main/java/com/nis/web/service/configuration/FileTransferCfgService.java b/src/main/java/com/nis/web/service/configuration/FileTransferCfgService.java index 09eb8ee34..f0b8dcabd 100644 --- a/src/main/java/com/nis/web/service/configuration/FileTransferCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/FileTransferCfgService.java @@ -378,6 +378,8 @@ public class FileTransferCfgService extends CrudService subscribeidList = fileTransferCfgDao.getFileDigestSubscribeidList(entity); + entity.setNtcSubscribeIdCfgList(subscribeidList); return entity; } @@ -402,18 +404,21 @@ public class FileTransferCfgService extends CrudService:"+null); - } + entity.setRawLen(result.getData().getRawLen()); + entity.setDigest(result.getData().getDigest()); + entity.setFileUrl(result.getData().getAccessUrl()); + mailCfgDao.saveMailFileDigestCfg(entity); + // 保存SubscribeId域配置信息 + if(entity.getNtcSubscribeIdCfgList()!=null){ + for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ + if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + fileTransferCfgDao.saveP2pSubscribeIdCfg(cfg); + } + } + } //保存区域IP信息 if(entity.getAreaCfg()!=null&&entity.getAreaCfg().size()>0){ for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) { @@ -427,12 +432,26 @@ public class FileTransferCfgService extends CrudService ntcList = stringCfgDao.findSubscribeIdCfgList(ntcSubscribeIdCfg); + entity.setNtcSubscribeIdCfgList(ntcList); + } + return entity; + } + public Page getP2pList(Page page, CfgIndexInfo entity){ // 生成数据权限过滤条件(dsf为dataScopeFilter的简写,在xml中使用 ${sqlMap.dsf}调用权限SQL) entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); @@ -943,4 +973,5 @@ public class FileTransferCfgService 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/java/com/nis/web/service/specific/SpecificServiceCfgService.java b/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java index 7d2815985..b66c34826 100644 --- a/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java +++ b/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java @@ -12,6 +12,7 @@ import com.nis.domain.Page; import com.nis.domain.specific.ConfigGroupInfo; import com.nis.domain.specific.SpecificServiceCfg; import com.nis.util.ConfigServiceUtil; +import com.nis.util.Constants; import com.nis.web.dao.specific.SpecificServiceCfgDao; import com.nis.web.service.BaseService; @@ -89,6 +90,21 @@ public class SpecificServiceCfgService extends BaseService{ specificServiceCfg.setIsValid(1); specificServiceCfg.setOpTime(new Date()); + //用户添加的需要自增 + if(specificServiceCfg.getAddFlag()!=null) { + Integer serviceCode=specificServiceCfgDao.getMaxServiceCode(Constants.APP_SPEC_SERVICE_CODE_MAX_VAL,specificServiceCfg.getCfgType(),specificServiceCfg.getAddFlag()); + if(serviceCode==null) {//用户没有添加标签,获取最大的 + serviceCode=specificServiceCfgDao.getMaxServiceCode(Constants.APP_SPEC_SERVICE_CODE_MAX_VAL,specificServiceCfg.getCfgType(),null); + } + if(serviceCode==null) {//没有标签,取开始值 + serviceCode=Constants.APP_SPEC_SERVICE_CODE_MIN_VAL; + }else if(serviceCode>Constants.APP_SPEC_SERVICE_CODE_MAX_VAL){ + throw new RuntimeException("Get specific service code failed,specific service code is beyond the scope of application"); + }else if(serviceCodeservice_name================= #=============about report=================== -report_list=\u62A5\u8868 -hour_of_day_report=\u5C0F\u65F6\u62A5 -day_of_month_report=\u5F53\u6708\u65E5\u62A5 -month_report=\u6708\u62A5 -label_report=\u6807\u7B7E\u62A5\u8868 -attr_type_report=\u6027\u8D28\u62A5\u8868 -lwhh_report=\u6765\u6587\u51FD\u53F7\u62A5\u8868 -src_ip_report=\u5883\u5185\u6E90IP\u62A5\u8868 -dest_ip_report=\u76EE\u7684\u56FD\u5BB6IP\u62A5\u8868 -isp_report=\u8FD0\u8425\u5546\u5C40\u70B9\u62A5\u8868 +report_list=\u62a5\u8868 +hour_of_day_report=\u5c0f\u65f6\u62a5 +day_of_month_report=\u5f53\u6708\u65e5\u62a5 +month_report=\u6708\u62a5 +label_report=\u6807\u7b7e\u62a5\u8868 +attr_type_report=\u6027\u8d28\u62a5\u8868 +lwhh_report=\u6765\u6587\u51fd\u53f7\u62a5\u8868 +src_ip_report=\u5883\u5185\u6e90IP\u62a5\u8868 +dest_ip_report=\u76ee\u7684\u56fd\u5bb6IP\u62a5\u8868 +isp_report=\u8fd0\u8425\u5546\u5c40\u70b9\u62a5\u8868 #=============about report=================== -ip_multiplex_policy=IP\u590D\u7528\u7B56\u7565 -ip_multiplex_pool_config=IP\u590D\u7528\u5730\u5740\u6C60 -letter=\u6765\u51FD -show_more=\u5C55\u793A\u66F4\u591A +ip_multiplex_policy=IP\u590d\u7528\u7b56\u7565 +ip_multiplex_pool_config=IP\u590d\u7528\u5730\u5740\u6c60 +letter=\u6765\u51fd +show_more=\u5c55\u793a\u66f4\u591a #===============dashboard begin=================================== -dashboard=\u7EDF\u8BA1\u56FE\u8868 -traffic_chart=\u6D41\u91CF\u7EDF\u8BA1 -os_type=\u64CD\u4F5C\u7CFB\u7EDF\u5206\u7C7B -browser_type=\u6D4F\u89C8\u5668\u5206\u7C7B -traffic_protocol_chart=\u534F\u8BAE\u7C7B\u578B TOP10 -traffic_ipactive_chart=\u6D3B\u8DC3IP TOP10 -traffic_app_chart=APP\u6D41\u91CF TOP10 -traffic_ua_list=\u7EC8\u7AEF\u7528\u6237 TOP10 -traffic_ua_chart=\u7EC8\u7AEF -ranking=\u6392\u540D -os=\u7CFB\u7EDF -browser=\u6D4F\u89C8\u5668 -trend=\u8D8B\u52BF -traffic_website_list=\u7F51\u7AD9\u6D41\u91CFTOP10 -traffic_website_type_chart=\u7F51\u7AD9\u5206\u7C7B -website=\u7F51\u7AD9\u540D\u79F0 +dashboard=\u7edf\u8ba1\u56fe\u8868 +traffic_chart=\u6d41\u91cf\u7edf\u8ba1 +os_type=\u64cd\u4f5c\u7cfb\u7edf\u5206\u7c7b +browser_type=\u6d4f\u89c8\u5668\u5206\u7c7b +traffic_protocol_chart=\u534f\u8bae\u7c7b\u578b TOP10 +traffic_ipactive_chart=\u6d3b\u8dc3IP TOP10 +traffic_app_chart=APP\u6d41\u91cf TOP10 +traffic_ua_list=\u7ec8\u7aef\u7528\u6237 TOP10 +traffic_ua_chart=\u7ec8\u7aef +ranking=\u6392\u540d +os=\u7cfb\u7edf +browser=\u6d4f\u89c8\u5668 +trend=\u8d8b\u52bf +traffic_website_list=\u7f51\u7ad9\u6d41\u91cfTOP10 +traffic_website_type_chart=\u7f51\u7ad9\u5206\u7c7b +website=\u7f51\u7ad9\u540d\u79f0 #===============dashboard end=================================== -ratelimit_limit=\u9650\u901F\u6BD4\u4F8B\u5FC5\u987B\u4ECB\u4E8E0\u5230100 -Maintenance=\u9AD8\u7EA7\u529F\u80FD -Proxy=\u56FD\u5BB6\u4EE3\u7406 -selective=\u9009\u62E9\u533A\u57DF -max_shouldnot_less_than_min=\u6700\u5927\u9879\u4E0D\u80FD\u5C0F\u4E8E\u6700\u5C0F\u9879 -unknown_cfg_type=\u672A\u77E5\u7684\u914D\u7F6E\u7C7B\u578B -basic_protocol_reject=\u57FA\u7840\u534F\u8BAE\u963B\u65AD -basic_protocol_ratelimit=\u57FA\u7840\u534F\u8BAE\u9650\u901F -basic_protocol_monit=\u57FA\u7840\u534F\u8BAE\u76D1\u6D4B -basic_protocol_drop=\u57FA\u7840\u534F\u8BAE\u4E22\u5F03 -encrypted_tunnel_behavior_reject=\u52A0\u5BC6\u96A7\u9053\u884C\u4E3A\u963B\u65AD -encrypted_tunnel_behavior_ratelimit=\u52A0\u5BC6\u96A7\u9053\u884C\u4E3A\u9650\u901F -encrypted_tunnel_behavior_monit=\u52A0\u5BC6\u96A7\u9053\u884C\u4E3A\u76D1\u6D4B -encrypted_tunnel_behavior_drop=\u52A0\u5BC6\u96A7\u9053\u884C\u4E3A\u4E22\u5F03 -ip_protocol=IP\u534F\u8BAE -MM_AV_IP=\u97F3\u89C6\u9891IP -MM_PIC_IP=\u56FE\u7247IP -MM_PIC_URL=\u56FE\u7247URL -MM_AV_URL=\u97F3\u89C6\u9891URL -#INLINE_IP_CB=\u4E32\u8054IP +ratelimit_limit=\u9650\u901f\u6bd4\u4f8b\u5fc5\u987b\u4ecb\u4e8e0\u5230100 +Maintenance=\u9ad8\u7ea7\u529f\u80fd +Proxy=\u56fd\u5bb6\u4ee3\u7406 +selective=\u9009\u62e9\u533a\u57df +max_shouldnot_less_than_min=\u6700\u5927\u9879\u4e0d\u80fd\u5c0f\u4e8e\u6700\u5c0f\u9879 +unknown_cfg_type=\u672a\u77e5\u7684\u914d\u7f6e\u7c7b\u578b +basic_protocol_reject=\u57fa\u7840\u534f\u8bae\u963b\u65ad +basic_protocol_ratelimit=\u57fa\u7840\u534f\u8bae\u9650\u901f +basic_protocol_monit=\u57fa\u7840\u534f\u8bae\u76d1\u6d4b +basic_protocol_drop=\u57fa\u7840\u534f\u8bae\u4e22\u5f03 +encrypted_tunnel_behavior_reject=\u52a0\u5bc6\u96a7\u9053\u884c\u4e3a\u963b\u65ad +encrypted_tunnel_behavior_ratelimit=\u52a0\u5bc6\u96a7\u9053\u884c\u4e3a\u9650\u901f +encrypted_tunnel_behavior_monit=\u52a0\u5bc6\u96a7\u9053\u884c\u4e3a\u76d1\u6d4b +encrypted_tunnel_behavior_drop=\u52a0\u5bc6\u96a7\u9053\u884c\u4e3a\u4e22\u5f03 +ip_protocol=IP\u534f\u8bae +MM_AV_IP=\u97f3\u89c6\u9891IP +MM_PIC_IP=\u56fe\u7247IP +MM_PIC_URL=\u56fe\u7247URL +MM_AV_URL=\u97f3\u89c6\u9891URL +#INLINE_IP_CB=\u4e32\u8054IP MM_VOIP_IP=VoIP IP -MM_VOIP_ACCOUNT=VoIP\u8D26\u53F7 +MM_VOIP_ACCOUNT=VoIP\u8d26\u53f7 #=======================for import ip configuration================= -drop_ip=IP\u4E22\u5F03 -loop_ip=IP\u56DE\u6D41 -drop_or_loop_ip=IP\u4E22\u5F03/\u56DE\u6D41 -reject_or_monit_ip=IP\u963B\u65AD/\u76D1\u6D4B -reject_ip=IP\u963B\u65AD -monit_ip=IP\u76D1\u6D4B -ir_ip=IP\u590D\u7528 -ratelimit_ip=IP\u9650\u6D41 -app_code=\u793E\u4EA4\u5E94\u7528\u5E8F\u53F7 -app_name=\u793E\u4EA4\u5E94\u7528\u540D\u79F0 -app_desc=\u793E\u4EA4\u5E94\u7528\u63CF\u8FF0 -tunnel_code=\u52A0\u5BC6\u96A7\u9053\u884C\u4E3A\u5E8F\u53F7 -tunnel_name=\u52A0\u5BC6\u96A7\u9053\u884C\u4E3A\u540D\u79F0 -tunnel_desc=\u52A0\u5BC6\u96A7\u9053\u884C\u4E3A\u63CF\u8FF0 -call_external_procedures_failed=\u8C03\u7528\u5916\u90E8\u7A0B\u5E8F\u51FA\u9519 -is_hex=\u662F\u5426\u5341\u516D\u8FDB\u5236 -is_case_insenstive=\u662F\u5426\u5927\u5C0F\u5199\u654F\u611F -case_senstive=\u5927\u5C0F\u5199\u654F\u611F -case_insenstive=\u5927\u5C0F\u5199\u4E0D\u654F\u611F -hex=\u5341\u516D\u8FDB\u5236 -not_hex=\u975E\u5341\u516D\u8FDB\u5236 +drop_ip=IP\u4e22\u5f03 +loop_ip=IP\u56de\u6d41 +drop_or_loop_ip=IP\u4e22\u5f03/\u56de\u6d41 +reject_or_monit_ip=IP\u963b\u65ad/\u76d1\u6d4b +reject_ip=IP\u963b\u65ad +monit_ip=IP\u76d1\u6d4b +ir_ip=IP\u590d\u7528 +ratelimit_ip=IP\u9650\u6d41 +app_code=\u793e\u4ea4\u5e94\u7528\u5e8f\u53f7 +app_name=\u793e\u4ea4\u5e94\u7528\u540d\u79f0 +app_desc=\u793e\u4ea4\u5e94\u7528\u63cf\u8ff0 +tunnel_code=\u52a0\u5bc6\u96a7\u9053\u884c\u4e3a\u5e8f\u53f7 +tunnel_name=\u52a0\u5bc6\u96a7\u9053\u884c\u4e3a\u540d\u79f0 +tunnel_desc=\u52a0\u5bc6\u96a7\u9053\u884c\u4e3a\u63cf\u8ff0 +call_external_procedures_failed=\u8c03\u7528\u5916\u90e8\u7a0b\u5e8f\u51fa\u9519 +is_hex=\u662f\u5426\u5341\u516d\u8fdb\u5236 +is_case_insenstive=\u662f\u5426\u5927\u5c0f\u5199\u654f\u611f +case_senstive=\u5927\u5c0f\u5199\u654f\u611f +case_insenstive=\u5927\u5c0f\u5199\u4e0d\u654f\u611f +hex=\u5341\u516d\u8fdb\u5236 +not_hex=\u975e\u5341\u516d\u8fdb\u5236 -p2p_reject=P2P\u7BA1\u63A7 -NTC_P2P_IP=IP\u914D\u7F6E -NTC_P2P_HASH_BIN=HASH\u914D\u7F6E -NTC_P2P_KEYWORDS=\u5185\u5BB9\u5173\u952E\u5B57\u914D\u7F6E +p2p_reject=P2P\u7ba1\u63a7 +NTC_P2P_IP=IP\u914d\u7f6e +NTC_P2P_HASH_BIN=HASH\u914d\u7f6e +NTC_P2P_KEYWORDS=\u5185\u5bb9\u5173\u952e\u5b57\u914d\u7f6e -s_asn=\u5BA2\u6237\u7AEFASN -d_asn=\u670D\u52A1\u7AEFASN -s_subscribe_id=\u5BA2\u6237\u7AEF\u7528\u6237\u540D -d_subscribe_id=\u670D\u52A1\u7AEF\u7528\u6237\u540D -scene_file=\u73B0\u573A\u65E5\u5FD7\u6587\u4EF6\u5730\u5740 -req_hdr_key=\u8BF7\u6C42\u5934\u8F6C\u50A8\u6587\u4EF6KEY -req_body_key=\u8BF7\u6C42\u4F53\u8F6C\u50A8\u6587\u4EF6KEY -res_hdr_key=\u5E94\u7B54\u5934\u8F6C\u50A8\u6587\u4EF6KEY -res_body_key=\u5E94\u7B54\u4F53\u8F6C\u50A8\u6587\u4EF6KEY -website=\u7F51\u7AD9\u57DF\u540D +s_asn=\u5ba2\u6237\u7aefASN +d_asn=\u670d\u52a1\u7aefASN +s_subscribe_id=\u5ba2\u6237\u7aef\u7528\u6237\u540d +d_subscribe_id=\u670d\u52a1\u7aef\u7528\u6237\u540d +scene_file=\u73b0\u573a\u65e5\u5fd7\u6587\u4ef6\u5730\u5740 +req_hdr_key=\u8bf7\u6c42\u5934\u8f6c\u50a8\u6587\u4ef6KEY +req_body_key=\u8bf7\u6c42\u4f53\u8f6c\u50a8\u6587\u4ef6KEY +res_hdr_key=\u5e94\u7b54\u5934\u8f6c\u50a8\u6587\u4ef6KEY +res_body_key=\u5e94\u7b54\u4f53\u8f6c\u50a8\u6587\u4ef6KEY +website=\u7f51\u7ad9\u57df\u540d -p2p_ip_config_type=IP\u914D\u7F6E\u7C7B\u578B -p2p_hash_type=HASH\u7C7B\u578B -NTC_SUBSCRIBE_ID=\u8BA4\u8BC1\u6807\u8BC6\u914D\u7F6E +p2p_ip_config_type=IP\u914d\u7f6e\u7c7b\u578b +p2p_hash_type=HASH\u7c7b\u578b +NTC_SUBSCRIBE_ID=\u8ba4\u8bc1\u6807\u8bc6\u914d\u7f6e -app_header_config=APP\u5C42\u5934\u7279\u5F81 -app_ssl_config=APP SSL\u8BC1\u4E66\u7279\u5F81 -ip_intercepter_replace=IP\u62E6\u622A\u66FF\u6362 -domain_intercepter_replace=\u57DF\u540D\u62E6\u622A\u66FF\u6362 -ip_intercepter_ratelimit=IP\u62E6\u622A\u9650\u901F -domain_intercepter_ratelimit=\u57DF\u540D\u62E6\u622A\u9650\u901F -app_built_in_features_config=APP\u5185\u7F6E\u7279\u5F81\u7EF4\u62A4 -PXY_INTERCEPT_PKT_BIN=\u62E6\u622A\u62A5\u6587 -certificate=\u8BC1\u4E66 -do_log=\u662F\u5426\u8BB0\u5F55\u65E5\u5FD7 -no_log=\u4E0D\u8BB0\u5F55 -all_log=\u8BB0\u5F55\u6240\u6709\u65E5\u5FD7 -framework_log=\u53EA\u8BB0\u5F55\u7ED3\u6784\u5316\u65E5\u5FD7 -file_strategy=\u6587\u4EF6\u7B56\u7565 -file_desc=\u6587\u4EF6\u63CF\u8FF0 -content_type=\u5185\u5BB9\u7C7B\u578B -content_length=\u6587\u4EF6\u957F\u5EA6 -response_file=\u54CD\u5E94\u6587\u4EF6 -APP_SUBSCRIBE_ID=\u8BA4\u8BC1\u6807\u8BC6\u914D\u7F6E -reply_file=\u54CD\u5E94\u6587\u4EF6 \ No newline at end of file +app_header_config=APP\u5c42\u5934\u7279\u5f81 +app_ssl_config=APP SSL\u8bc1\u4e66\u7279\u5f81 +ip_intercepter_replace=IP\u62e6\u622a\u66ff\u6362 +domain_intercepter_replace=\u57df\u540d\u62e6\u622a\u66ff\u6362 +ip_intercepter_ratelimit=IP\u62e6\u622a\u9650\u901f +domain_intercepter_ratelimit=\u57df\u540d\u62e6\u622a\u9650\u901f +app_built_in_features_config=APP\u5185\u7f6e\u7279\u5f81\u7ef4\u62a4 +PXY_INTERCEPT_PKT_BIN=\u62e6\u622a\u62a5\u6587 +certificate=\u8bc1\u4e66 +do_log=\u662f\u5426\u8bb0\u5f55\u65e5\u5fd7 +no_log=\u4e0d\u8bb0\u5f55 +all_log=\u8bb0\u5f55\u6240\u6709\u65e5\u5fd7 +framework_log=\u53ea\u8bb0\u5f55\u7ed3\u6784\u5316\u65e5\u5fd7 +file_strategy=\u6587\u4ef6\u7b56\u7565 +file_desc=\u6587\u4ef6\u63cf\u8ff0 +content_type=\u5185\u5bb9\u7c7b\u578b +content_length=\u6587\u4ef6\u957f\u5ea6 +response_file=\u54cd\u5e94\u6587\u4ef6 +APP_SUBSCRIBE_ID=\u8ba4\u8bc1\u6807\u8bc6\u914d\u7f6e +reply_file=\u54cd\u5e94\u6587\u4ef6 +app_topic_domain_cfg=\u4e3b\u9898\u7f51\u7ad9 +#=====================about app Tcp================================= +min_tcp=\u6700\u5c0f\u4f1a\u8bdd\u6570 +max_tcp=\u6700\u5927\u4f1a\u8bdd\u6570 +tcp_unit=\u5355\u4f4d/\u5b57\u8282 +app_tcp_config=APP TCP\u4f1a\u8bdd\u5b57\u8282\u6570\u7279\u5f81 +app_tcp_max_min=\u6700\u5927\u4f1a\u8bdd\u6570\u4e0d\u80fd\u8d85\u8fc74294967295 +new=新 +BASIC_PROTOCOL_BUSINESS_TYPE=基础协议业务类别 +TUNNEL_BEHAV_BUSINESS_TYPE=加密隧道行为业务类别 +APP_BUSINESS_TYPE=社交应用业务类别 \ No newline at end of file diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index 9ec763708..00420a5a3 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -461,4 +461,7 @@ maat_cfg_dolog_configpercent_default=100 maat_cfg_dolog_configoption_default=1 #app\uff0c\u57fa\u7840\u534f\u8bae\uff0c\u7279\u5b9a\u670d\u52a1\u7684userregion\u5206\u9694\u7b26 app_cfg_userregion_splitor=& -app_id_region=APP_ID \ No newline at end of file +app_id_region=APP_ID +#application spec service code scope +app_spec_service_code_max_val=310000 +app_spec_service_code_min_val=300001 \ No newline at end of file diff --git a/src/main/resources/sql/add_spec_add_flag.sql b/src/main/resources/sql/add_spec_add_flag.sql new file mode 100644 index 000000000..5a8e0b956 --- /dev/null +++ b/src/main/resources/sql/add_spec_add_flag.sql @@ -0,0 +1 @@ +ALTER TABLE specific_service_cfg ADD add_flag INT(11) NULL COMMENT '添加标记,APP特征界面上添加的为用户自己添加的'; \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/tags/sys/treeselect.tag b/src/main/webapp/WEB-INF/tags/sys/treeselect.tag index 81086544f..7d921eca3 100644 --- a/src/main/webapp/WEB-INF/tags/sys/treeselect.tag +++ b/src/main/webapp/WEB-INF/tags/sys/treeselect.tag @@ -26,6 +26,7 @@ <%@ attribute name="showParentName" type="java.lang.String" required="false" description="显示父类名称"%> <%@ attribute name="checkedPS" type="java.lang.String" required="false" description="复选框选中时是否关联父子节点,ps关联父子,p关联父,s关联子,都不关联为空"%> <%@ attribute name="unCheckedPS" type="java.lang.String" required="false" description="复选框取消选中时是否关联父子节点,ps关联父子,p关联父,s关联子,都不关联为空"%> +<%@ attribute name="enableAddBtn" type="java.lang.Boolean" required="false" description="节点是否可编辑"%>
" data-msg-required="${dataMsgRequired}" placeholder="${empty value?labelValue:value}" @@ -45,7 +46,7 @@ return true; } // 正常打开 - top.$.jBox.open("iframe:${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&selectIds="+$("#${id}Id").val()+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}&title=${title}", " ", 320, 420, { + top.$.jBox.open("iframe:${ctx}/tag/treeselect?url="+encodeURIComponent("${url}")+"&selectIds="+$("#${id}Id").val()+"&module=${module}&checked=${checked}&extId=${extId}&isAll=${isAll}&title=${title}&enableAddBtn=${enableAddBtn}", " ", 320, 420, { ajaxData:{selectIds: $("#${id}Id").val()},buttons:{"":"ok", "":"clear","":true}, submit:function(v, h, f){ if (v == "ok"){ var tree = h.find("iframe")[0].contentWindow.tree;//h.find("iframe").contents(); @@ -57,6 +58,7 @@ } //wx提示,c:if标签前加了//注释,c:if标签的判断条件仍会生效 for(var i=0; i if (nodes[i].isParent && "${checkedPS}"!=''){ continue; // 如果为复选框选择,并且父子节点有关联,则过滤掉父节点 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 e2d27aa66..facf44d90 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appByteCfgForm.jsp @@ -82,7 +82,7 @@ $(function(){
@@ -142,22 +142,13 @@ $(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 77cd82995..9b8659eb9 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appDomainCfgForm.jsp @@ -142,22 +142,13 @@ $(function(){
-
+ diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgForm.jsp index 3eea1c739..c9c845482 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appHeaderCfgForm.jsp @@ -171,22 +171,13 @@ $(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 95ec2f585..fc3a2a519 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appHttpCfgForm.jsp @@ -170,22 +170,13 @@ $(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 c3b62f4f6..7f981a974 100644 --- a/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/app/appIpCfgForm.jsp @@ -78,7 +78,7 @@ $(function(){
@@ -185,23 +185,14 @@ $(function(){
-
+
+ +
+
+
+ + + + + + + + + + + + +
+
+
+ + + @@ -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 @@ + + + + +
+
+
+
+ +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+
diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmAvIpList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmAvIpList.jsp index a72fa4de3..57d0f5544 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmAvIpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmAvIpList.jsp @@ -32,7 +32,6 @@ $(document).ready(function(){

-
@@ -216,11 +215,11 @@ $(document).ready(function(){ ${log.pid} - - ${log.url} + + ${fn:substring(log.url,7,-1)} - - http://${log.url} + + ${log.url} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmAvUrlList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmAvUrlList.jsp index 1cfad6620..988af93b3 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmAvUrlList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmAvUrlList.jsp @@ -215,11 +215,11 @@ $(document).ready(function(){ ${log.pid} - - ${log.url} + + ${fn:substring(log.url,7,-1)} - - http://${log.url} + + ${log.url} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmPicIpList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmPicIpList.jsp index d0e5c5c41..827155ca3 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmPicIpList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmPicIpList.jsp @@ -217,12 +217,12 @@ $(document).ready(function(){ ${log.pid} - - ${log.url} - - - http://${log.url} - + + ${fn:substring(log.url,7,-1)} + + + ${log.url} + diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmPicUrlList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmPicUrlList.jsp index ae0b1c035..31296520f 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmPicUrlList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmPicUrlList.jsp @@ -217,11 +217,11 @@ $(document).ready(function(){ ${log.pid} - - ${log.url} + + ${fn:substring(log.url,7,-1)} - - http://${log.url} + + ${log.url} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmPornAudioSampleList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmPornAudioSampleList.jsp index 066d106ef..ac8905379 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmPornAudioSampleList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmPornAudioSampleList.jsp @@ -217,11 +217,11 @@ $(document).ready(function(){ ${log.pid} - - ${log.url} + + ${fn:substring(log.url,7,-1)} - - http://${log.url} + + ${log.url} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmPornVideoSampleList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmPornVideoSampleList.jsp index f8b128211..a3c84b5b4 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmPornVideoSampleList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmPornVideoSampleList.jsp @@ -217,11 +217,11 @@ $(document).ready(function(){ ${log.pid} - - ${log.url} + + ${fn:substring(log.url,7,-1)} - - http://${log.url} + + ${log.url} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp index d1c619c3b..7a0ea5edc 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleAudioList.jsp @@ -275,11 +275,11 @@ ${log.pid} - - ${log.url} - - - http://${log.url} + + ${fn:substring(log.url,7,-1)} + + + ${log.url} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSamplePicList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSamplePicList.jsp index 60b9cde87..f4c9df7c0 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSamplePicList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSamplePicList.jsp @@ -217,11 +217,11 @@ $(document).ready(function(){ ${log.pid} - - ${log.url} + + ${fn:substring(log.url,7,-1)} - - http://${log.url} + + ${log.url} diff --git a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp index e9d01a01b..06d9c9f00 100644 --- a/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp +++ b/src/main/webapp/WEB-INF/views/log/ntc/mmSampleVideoList.jsp @@ -217,11 +217,11 @@ $(document).ready(function(){ ${log.pid} - - ${log.url} + + ${fn:substring(log.url,7,-1)} - - http://${log.url} + + ${log.url} diff --git a/src/main/webapp/WEB-INF/views/sys/tagTreeselect.jsp b/src/main/webapp/WEB-INF/views/sys/tagTreeselect.jsp index 079944d8a..7abd40592 100644 --- a/src/main/webapp/WEB-INF/views/sys/tagTreeselect.jsp +++ b/src/main/webapp/WEB-INF/views/sys/tagTreeselect.jsp @@ -6,12 +6,33 @@ 数据选择 + <%--解决ztree add小图标丢失 --%> +