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..bace8c006 --- /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 Integer 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 Integer getTopic() { + return topic; + } + + public void setTopic(Integer 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/web/controller/configuration/AppCfgController.java b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java index b619ddb04..9c79e0eee 100644 --- a/src/main/java/com/nis/web/controller/configuration/AppCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/AppCfgController.java @@ -24,9 +24,11 @@ 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.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.Constants; import com.nis.util.DictUtils; @@ -864,4 +866,141 @@ 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(AppDomainCfg entity:page.getList()){ +// SpecificServiceCfg app = specificServiceCfgService.getBySpecServiceId(entity.getSpecServiceId()); +// entity.setAppName(app.getSpecServiceName()); +// } + 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,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/dao/configuration/AppCfgDao.java b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.java index 7c15dd79b..e46fa0e3b 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,7 @@ 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.AppTopicDomainCfg; import com.nis.domain.configuration.BaseCfg; import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.ComplexkeywordCfg; @@ -57,6 +58,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) ; 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..af72be5b4 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 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -332,6 +363,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 +397,17 @@ #{areaEffectiveIds,jdbcType=VARCHAR},#{ratelimit,jdbcType=INTEGER},#{functionId,jdbcType=INTEGER}, #{cfgType,jdbcType=VARCHAR},#{cfgRegionCode,jdbcType=INTEGER} + + #{topic,jdbcType=INTEGER},#{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 +488,13 @@ FROM app_domain_cfg r WHERE CFG_ID = #{cfgId,jdbcType=BIGINT} + + + + + + +<%-- --%> +<%-- --%> +
+ +
+ <%--
+ +
+ +
+ +
+
+
+
--%> +
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ +
+
+ +
+ +
+
+
+
+ <%--
+
+ + + + + + + + + + + +
+
--%> +
+ + + + +
+
+
+ + +
+ + + + + + > + + + + + + + + + + + + + +
+
+ +
+
+ +
+
+ +
+ +
+
+
+
+
+
+ +
+
+ +
+ + +
+
+
+
+
+
+ +
+ + +
+
+
+
+
+ +
+
+ +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+
+ + <%-- <%@include file="/WEB-INF/include/form/areaInfo.jsp" %> --%> + + <%-- <%@include file="/WEB-INF/include/form/basicInfo.jsp" %> --%> +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgList.jsp b/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgList.jsp new file mode 100644 index 000000000..5ff34f585 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/app/appTopicDomainCfgList.jsp @@ -0,0 +1,434 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + + + +
+ + + + + +

+ + +

+ +
+
+
+
+ + + + + + + + + + +
+
+ + + + + + + + +
+ + <%--
+ + +
--%> +
+
+
+ + + + + + + +
+ + + +
+
+
+ + + +
+
+ + + + + +
+ + +
+
+ href="javascript:;"> + + +
+
+ + + +
+ + +
+
+
+ + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+
+
+ + +
+
+
+ + + + + + + + + + + + <%-- + + + + + + --%> + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> + <%-- + + + + + --%> + + + + + + + + + + + + +
+ + ${cfg.compileId }${cfg.cfgDesc }${cfg.topic }${cfg.domain } + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${cfg.requestName } + + + + + + + + + + + + + + + ${fns:abbr(classify,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(attribute,20)} + + + + + + + + + + + + + + + + + + ${fns:abbr(lableInfo,20)} + + + + + + + + + + + + +
${cfg.creatorName }${cfg.editorName }${cfg.auditorName }
+
${page}
+
+ +
+
+
+ + + \ No newline at end of file