From 96217e2910004f57b714469b4d2057b1fe865d5f Mon Sep 17 00:00:00 2001 From: duandongmei Date: Thu, 23 Aug 2018 09:30:37 +0800 Subject: [PATCH 01/11] =?UTF-8?q?mail,dns,ssl,http=E5=86=B2=E7=AA=81?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/dao/configuration/AvContentCfgDao.xml | 38 +---------- src/main/resources/nis.properties | 13 ++-- .../WEB-INF/views/cfg/mail/mailForm.jsp | 47 ++++++++++++-- .../WEB-INF/views/cfg/website/dnsForm.jsp | 42 +++++++++++++ .../WEB-INF/views/cfg/website/httpForm.jsp | 63 +++++++++---------- 5 files changed, 125 insertions(+), 78 deletions(-) diff --git a/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.xml index c0cfd3a32..76761407c 100644 --- a/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.xml @@ -182,7 +182,7 @@ r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable ,r.area_effective_ids,r.function_id,r.cfg_region_code - + r.cfg_id,r.cfg_desc,r.cfg_keywords,r.cfg_type, 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, @@ -481,26 +481,7 @@ - - + - - - - - - - - - - - - @@ -403,7 +380,7 @@

- + @@ -420,6 +397,28 @@

+ + +
+ +

+ + +

+ <%-- --%> + + +
hidden disabled "> + + <%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%> +
+
+
+ +
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%> From 1cec30a6b125cdc9e03c6ebd20da587d2759f040 Mon Sep 17 00:00:00 2001 From: duandongmei Date: Thu, 23 Aug 2018 09:35:39 +0800 Subject: [PATCH 02/11] =?UTF-8?q?ssl=E5=86=B2=E7=AA=81=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/views/cfg/website/sslForm.jsp | 53 ++++++++++++++++--- 1 file changed, 45 insertions(+), 8 deletions(-) diff --git a/src/main/webapp/WEB-INF/views/cfg/website/sslForm.jsp b/src/main/webapp/WEB-INF/views/cfg/website/sslForm.jsp index 53754f797..bc739e3d2 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/sslForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/sslForm.jsp @@ -13,14 +13,14 @@ $(document) .ready( function() { - initCommIpVal(); - /* $("#cancel").on("click", function() { + /*initCommIpVal(); + $("#cancel").on("click", function() { window.history.back(); - }); + });*/ $(".action").on("change", function() { $("#serviceId").val($(this).attr("serviceId")); $("#protocolId").val($(this).attr("protocolId")); - }); */ + }); $("#serviceId").val($(".action:checked").attr("serviceId")); $("#protocolId").val($(".action:checked").attr("protocolId")); $("#cfgFrom").validate( @@ -217,6 +217,7 @@ + @@ -257,7 +258,12 @@ class="glyphicon glyphicon-plus ${tabName}Add" onClick="addContent(this,'${tabName}')" title="add"> - + + + + + + <%-- --%> @@ -269,7 +275,9 @@ <%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%> - + + + @@ -277,14 +285,43 @@ - + + + + + + + + + + +
+ <%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%> +
+ + +
+
+
+ + + + +
- + + + + + + From 82664d2f2142308503b917ec0ede7029061359b0 Mon Sep 17 00:00:00 2001 From: duandongmei Date: Thu, 23 Aug 2018 10:01:28 +0800 Subject: [PATCH 03/11] =?UTF-8?q?dns=20mail=20http=20ssl=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?subscribeId=E4=B8=9A=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/util/Constants.java | 1 + .../configuration/ntc/MailCfgController.java | 10 + .../configuration/ntc/WebsiteController.java | 37 +- .../dao/configuration/AvContentCfgDao.java | 3 - .../web/dao/configuration/StringCfgDao.java | 4 +- .../web/dao/configuration/StringCfgDao.xml | 43 +- .../configuration/AvContentCfgService.java | 10 +- .../service/configuration/MailCfgService.java | 135 +++++-- .../configuration/WebsiteCfgService.java | 371 +++++++++++------- src/main/resources/nis.properties | 2 +- .../resources/sql/add_function_region.sql | 19 + .../views/cfg/intercept/interceptIpForm.jsp | 7 + .../WEB-INF/views/cfg/mail/mailSubList.jsp | 55 +++ .../WEB-INF/views/cfg/website/dnsSubList.jsp | 55 +++ .../WEB-INF/views/cfg/website/httpList.jsp | 5 +- .../WEB-INF/views/cfg/website/httpSubList.jsp | 56 +++ .../WEB-INF/views/cfg/website/sslSubList.jsp | 54 ++- 17 files changed, 675 insertions(+), 192 deletions(-) create mode 100644 src/main/resources/sql/add_function_region.sql diff --git a/src/main/java/com/nis/util/Constants.java b/src/main/java/com/nis/util/Constants.java index 356931a1e..4c2ff5e96 100644 --- a/src/main/java/com/nis/util/Constants.java +++ b/src/main/java/com/nis/util/Constants.java @@ -447,6 +447,7 @@ public final class Constants { public static final String HTTP_REQ_HEAD_REGION = Configurations.getStringProperty("http_req_hdr_region","http_req_hdr"); public static final String HTTP_REQ_BODY_REGION = Configurations.getStringProperty("http_req_body_region","http_req_body"); public static final String HTTP_RES_HEAD_REGION = Configurations.getStringProperty("http_res_hdr_region","http_res_hdr"); + public static final String NTC_SUBSCRIBE_ID = Configurations.getStringProperty("ntc_subscribe_id","NTC_SUBSCRIBE_ID"); public static final String HTTP_RES_BODY_REGION = Configurations.getStringProperty("http_res_body_region","http_res_body"); public static final String HTTP_URL_REGION = Configurations.getStringProperty("http_url_region","http_url"); public static final String VOIP_IP_REGION = Configurations.getStringProperty("voip_ip","av_voip_ip"); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java b/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java index c08b5d2e3..bffad6486 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/MailCfgController.java @@ -28,6 +28,7 @@ import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.ComplexkeywordCfg; import com.nis.domain.configuration.FileDigestCfg; import com.nis.domain.configuration.IpPortCfg; +import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.domain.maat.ToMaatResult; import com.nis.exceptions.MaatConvertException; import com.nis.util.ConfigServiceUtil; @@ -131,6 +132,15 @@ public class MailCfgController 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/configuration/ntc/WebsiteController.java b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java index c8f2561f9..2f58cd72e 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java @@ -32,6 +32,7 @@ import com.nis.domain.configuration.HttpReqHeadCfg; import com.nis.domain.configuration.HttpResHeadCfg; import com.nis.domain.configuration.HttpUrlCfg; import com.nis.domain.configuration.IpPortCfg; +import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.exceptions.MaatConvertException; import com.nis.util.Constants; import com.nis.util.excel.ImportExcel; @@ -91,13 +92,18 @@ public class WebsiteController extends BaseController{ HttpBodyCfg resBodyCfg = new HttpBodyCfg(); resBodyCfg.setCfgType(Constants.HTTP_RES_BODY_REGION); entity.setHttpResBody(resBodyCfg); + NtcSubscribeIdCfg subscribeId = new NtcSubscribeIdCfg(); + subscribeId.setCfgType(Constants.NTC_SUBSCRIBE_ID); + entity.setNtcSubscribeIdCfg(subscribeId); int httpReqCfgNum = entity.getIpPortList().size()+ entity.getHttpUrlList().size()+ entity.getHttpReqBodyList().size()+ - entity.getHttpReqHdrList().size(); + entity.getHttpReqHdrList().size()+ + entity.getNtcSubscribeIdCfgList().size(); int httpResCfgNum = entity.getHttpResHdrList().size()+ - entity.getHttpResBodyList().size(); + entity.getHttpResBodyList().size()+ + entity.getNtcSubscribeIdCfgList().size(); model.addAttribute("httpReqCfgNum", httpReqCfgNum); model.addAttribute("httpResCfgNum", httpResCfgNum); if(entity.getIpPortList().size()==0){ @@ -118,6 +124,9 @@ public class WebsiteController extends BaseController{ if(entity.getHttpResBodyList().size()==0){ entity.getHttpResBodyList().add(resBodyCfg); } + if(entity.getNtcSubscribeIdCfgList().size()==0){ + entity.getNtcSubscribeIdCfgList().add(subscribeId); + } initUpdateFormCondition(model,entity); }else{ //设置http各类配置的配置域类型 @@ -139,6 +148,9 @@ public class WebsiteController extends BaseController{ HttpBodyCfg resBodyCfg = new HttpBodyCfg(); resBodyCfg.setCfgType(Constants.HTTP_RES_BODY_REGION); entity.setHttpResBody(resBodyCfg); + NtcSubscribeIdCfg subscribeIdCfg = new NtcSubscribeIdCfg(); + subscribeIdCfg.setCfgType(Constants.NTC_SUBSCRIBE_ID); + entity.setNtcSubscribeIdCfg(subscribeIdCfg); List ipList=new ArrayList(); ipList.add(ipCfg); @@ -158,6 +170,9 @@ public class WebsiteController extends BaseController{ List resBodyList=new ArrayList(); resBodyList.add(resBodyCfg); entity.setHttpResBodyList(resBodyList); + List subscribeIdList=new ArrayList(); + subscribeIdList.add(subscribeIdCfg); + entity.setNtcSubscribeIdCfgList(subscribeIdList); initFormCondition(model,entity); } @@ -257,6 +272,15 @@ public class WebsiteController 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); @@ -334,6 +358,15 @@ public class WebsiteController extends BaseController{ } } } + if(cfg.getNtcSubscribeIdCfgList()!=null){ + String cfgType = null; + for(NtcSubscribeIdCfg keyword:cfg.getNtcSubscribeIdCfgList()){ + if(!keyword.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"2",keyword.getCfgType()}); + cfgType = keyword.getCfgType(); + } + } + } model.addAttribute("_cfg", cfg); model.addAttribute("index", index); model.addAttribute("tabList", tabList); diff --git a/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.java b/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.java index 4aaa6b797..b4c568a31 100644 --- a/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.java @@ -9,7 +9,6 @@ import com.nis.domain.configuration.AvVoipIpCfg; import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.CfgIndexInfo; -import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.web.dao.MyBatisDao; @@ -19,7 +18,6 @@ public interface AvContentCfgDao { public List findAccountList(CfgIndexInfo entity) ; public List findVoipIpCfgList(CfgIndexInfo entity); public List findVoipAccountCfgList(CfgIndexInfo entity); - public List findSubscribeIdCfgList(CfgIndexInfo entity); public CfgIndexInfo getCfgIndexInfo(CfgIndexInfo entity); public void insertCfgIndexInfo(CfgIndexInfo entity); @@ -33,7 +31,6 @@ public interface AvContentCfgDao { public void updateAvVoipKeywordCfgt(CfgIndexInfo entity); public void deleteAvVoipIp(CfgIndexInfo entity); - public void deleteAvVoipKeywordCfg(CfgIndexInfo entity); public void deleteAvVoipAccountCfg(CfgIndexInfo entity); public BaseIpCfg findIpCfgById(BaseIpCfg entity) ; diff --git a/src/main/java/com/nis/web/dao/configuration/StringCfgDao.java b/src/main/java/com/nis/web/dao/configuration/StringCfgDao.java index d7186be30..c17db24b8 100644 --- a/src/main/java/com/nis/web/dao/configuration/StringCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/StringCfgDao.java @@ -5,6 +5,7 @@ import java.util.List; import org.apache.ibatis.annotations.Param; import com.nis.domain.configuration.BaseStringCfg; +import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.web.dao.CrudDao; import com.nis.web.dao.MyBatisDao; @@ -41,7 +42,8 @@ public interface StringCfgDao extends CrudDao{ * @since 1.0.0 */ public void deleteByCompileIds(@Param("user")long user,@Param("tableName")String tableName,@Param("compileIds")String compileIds); - + public List findSubscribeIdCfgListByCfgIndexInfo(CfgIndexInfo entity); + public void deleteSubscribeIdCfgByCfgIndexInfo(CfgIndexInfo entity); public List findSubscribeIdCfgList(NtcSubscribeIdCfg ntcSubscribeIdCfg); public void saveSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg); public void updateSubscribeIdCfg(NtcSubscribeIdCfg ntcSubscribeIdCfg); diff --git a/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml index 08c42a5e2..2d375284e 100644 --- a/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml @@ -65,7 +65,6 @@ - CFG_ID, CFG_DESC, CFG_KEYWORDS,CFG_TYPE,ACTION,IS_VALID,IS_AUDIT, CREATOR_ID,CREATE_TIME,EDITOR_ID,EDIT_TIME,AUDITOR_ID,AUDIT_TIME, @@ -518,6 +517,9 @@ from ntc_subscribe_id_cfg r + + and r.FUNCTION_ID=#{fucntionId,jdbcType=INTEGER} + and r.COMPILE_ID=#{compileId,jdbcType=INTEGER} @@ -690,5 +692,44 @@ + + + + + + delete from ntc_subscribe_id_cfg + + + and cfg_id = #{ntcSubscribeIdCfg.cfgId,jdbcType=INTEGER} + + + and compile_id = #{compileId,jdbcType=INTEGER} + + + and function_id = #{functionId,jdbcType=INTEGER} + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java b/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java index fcb7e015e..dc1b5d1d3 100644 --- a/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java @@ -107,7 +107,7 @@ public class AvContentCfgService extends BaseService{ * @return */ public List getSubscribeIdCfgList(CfgIndexInfo entity) { - return avContentCfgDao.findSubscribeIdCfgList(entity); + return stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity); } /** * 根据索引表信息获取voipAccountCfg信息 @@ -198,7 +198,7 @@ public class AvContentCfgService extends BaseService{ avContentCfgDao.updateCfgIndexInfo(entity); //无效子配置后,再新增子配置 avContentCfgDao.deleteAvVoipIp(entity); - avContentCfgDao.deleteAvVoipKeywordCfg(entity); + stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity); AreaIpCfg area = new AreaIpCfg(); area.setCompileId(entity.getCompileId()); area.setFunctionId(entity.getFunctionId()); @@ -280,7 +280,7 @@ public class AvContentCfgService extends BaseService{ entity.setEditorId(entity.getCurrentUser().getId()); avContentCfgDao.updateCfgIndexInfo(entity); //无效子配置后,再新增子配置 - avContentCfgDao.deleteAvVoipKeywordCfg(entity); + stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity); avContentCfgDao.deleteAvVoipAccountCfg(entity); AreaIpCfg area = new AreaIpCfg(); area.setCompileId(entity.getCompileId()); @@ -398,7 +398,7 @@ public class AvContentCfgService extends BaseService{ areaIpCfgDao.updateAreaIpCfg(areaIpCfg); voipIpList=avContentCfgDao.findVoipIpCfgList(entity); - ntcList=avContentCfgDao.findSubscribeIdCfgList(entity); + ntcList=stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity); areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); ToMaatBean maatBean = new ToMaatBean(); @@ -511,7 +511,7 @@ public class AvContentCfgService extends BaseService{ BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType","cfgId"}); areaIpCfgDao.updateAreaIpCfg(areaIpCfg); - ntcList=avContentCfgDao.findSubscribeIdCfgList(entity); + ntcList=stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity); accountList=avContentCfgDao.findVoipAccountCfgList(entity); areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); diff --git a/src/main/java/com/nis/web/service/configuration/MailCfgService.java b/src/main/java/com/nis/web/service/configuration/MailCfgService.java index 245446384..6d359fe36 100644 --- a/src/main/java/com/nis/web/service/configuration/MailCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/MailCfgService.java @@ -22,6 +22,7 @@ import com.nis.domain.configuration.ComplexkeywordCfg; import com.nis.domain.configuration.FileDigestCfg; import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.MailKeywordCfg; +import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.domain.maat.MaatCfg; import com.nis.domain.maat.ToMaatBean; import com.nis.domain.maat.ToMaatResult; @@ -37,6 +38,7 @@ import com.nis.util.FileUtils; import com.nis.util.JsonMapper; import com.nis.web.dao.configuration.AreaIpCfgDao; import com.nis.web.dao.configuration.MailCfgDao; +import com.nis.web.dao.configuration.StringCfgDao; import com.nis.web.security.UserUtils; import com.nis.web.service.CrudService; @@ -51,6 +53,10 @@ public class MailCfgService extends CrudService { protected MailCfgDao mailCfgDao; @Autowired protected AreaIpCfgDao areaIpCfgDao; + @Autowired + protected StringCfgDao stringCfgDao; + + public Page getMailList(Page page, CfgIndexInfo entity){ // 生成数据权限过滤条件(dsf为dataScopeFilter的简写,在xml中使用 ${sqlMap.dsf}调用权限SQL) entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); @@ -65,9 +71,11 @@ public class MailCfgService extends CrudService { List keywordList = mailCfgDao.getMailKeywordList(entity); List digestList = mailCfgDao.getMailFileDigestList(entity); List areaCfg = areaIpCfgDao.getByCompileId(entity.getCompileId()); + List ntcSubscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity); entity.setIpPortList(ipPortList); entity.setComplexList(keywordList); entity.setDigestList(digestList); + entity.setNtcSubscribeIdCfgList(ntcSubscribeIdList); entity.setAreaCfg(areaCfg); return entity; } @@ -79,6 +87,10 @@ public class MailCfgService extends CrudService { public void saveMailCfg(CfgIndexInfo entity,ToMaatResult result){ //设置区域运营商信息 setAreaEffectiveIds(entity); + + entity.setIsValid(0); + entity.setIsAudit(0); + if(entity.getCfgId()==null){ Integer compileId = 0; try { @@ -86,58 +98,67 @@ public class MailCfgService extends CrudService { if(idList!=null && idList.size()>0){ compileId = idList.get(0); } - entity.setCompileId(compileId); - entity.setCreateTime(new Date()); - entity.setCreatorId(entity.getCurrentUser().getId()); - mailCfgDao.saveCfgIndex(entity); - if(entity.getIpPortList()!=null){ - for(IpPortCfg cfg:entity.getIpPortList()){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - mailCfgDao.saveIpPortCfg(cfg); - } - } - if(entity.getComplexList()!=null){ - for(ComplexkeywordCfg cfg:entity.getComplexList()){ - if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){ - cfg.setDistrict(cfg.getDistrictShowName()); - } - mailCfgDao.saveMailKeywordCfg(cfg); - } - } - } - if(entity.getDigestList()!=null){ - for(FileDigestCfg cfg:entity.getDigestList()){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - if(result!=null && result.getData()!=null){ - cfg.setRawLen(result.getData().getRawLen()); - cfg.setDigest(result.getData().getDigest()); - cfg.setFileUrl(result.getData().getAccessUrl()); - } - mailCfgDao.saveMailFileDigestCfg(cfg); - } - } - //保存区域IP信息 - if(entity.getAreaCfg()!=null){ - for(AreaIpCfg cfg:entity.getAreaCfg()){ - cfg.initDefaultValue(); - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - areaIpCfgDao.saveAreaIpCfg(cfg); - } - } - } catch (Exception e) { - e.printStackTrace(); + } catch (MaatConvertException e) { logger.info("获取编译ID出错"); - throw new MaatConvertException(":"+e.getMessage()); + throw new MaatConvertException(""); + } + entity.setCompileId(compileId); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + mailCfgDao.saveCfgIndex(entity); + if(entity.getIpPortList()!=null){ + for(IpPortCfg cfg:entity.getIpPortList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + mailCfgDao.saveIpPortCfg(cfg); + } + } + if(entity.getComplexList()!=null){ + for(ComplexkeywordCfg cfg:entity.getComplexList()){ + if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){ + cfg.setDistrict(cfg.getDistrictShowName()); + } + mailCfgDao.saveMailKeywordCfg(cfg); + } + } + } + if(entity.getDigestList()!=null){ + for(FileDigestCfg cfg:entity.getDigestList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + if(result!=null && result.getData()!=null){ + cfg.setRawLen(result.getData().getRawLen()); + cfg.setDigest(result.getData().getDigest()); + cfg.setFileUrl(result.getData().getAccessUrl()); + } + mailCfgDao.saveMailFileDigestCfg(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()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } + } }else{ mailCfgDao.updateCfgIndex(entity); //无效子配置后,再新增子配置 mailCfgDao.deleteMailIpCfg(entity); mailCfgDao.deleteMailKeywordCfg(entity); mailCfgDao.deleteMailFileDigestCfg(entity); + stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity); AreaIpCfg area = new AreaIpCfg(); area.setCompileId(entity.getCompileId()); area.setFunctionId(entity.getFunctionId()); @@ -172,6 +193,14 @@ public class MailCfgService extends CrudService { mailCfgDao.saveMailFileDigestCfg(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()){ @@ -208,6 +237,13 @@ public class MailCfgService extends CrudService { cfg.setTableName(MailKeywordCfg.getTablename()); mailCfgDao.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()); + mailCfgDao.updateCfgValid(cfg); + } //保存区域IP信息 if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ AreaIpCfg cfg = new AreaIpCfg(); @@ -272,6 +308,19 @@ public class MailCfgService extends CrudService { digestRegionList=map.get("dstList"); } } + + if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){ + NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(NtcSubscribeIdCfg.getTablename()); + mailCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + } + //保存区域IP信息 if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ AreaIpCfg cfg = new AreaIpCfg(); diff --git a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java index e02d7d9c0..af7332b89 100644 --- a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java @@ -1,29 +1,17 @@ package com.nis.web.service.configuration; -import java.beans.PropertyDescriptor; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; import java.util.ArrayList; -import java.util.Arrays; import java.util.Date; -import java.util.HashMap; import java.util.List; import java.util.Map; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; -import org.springframework.beans.BeansException; -import org.springframework.beans.FatalBeanException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.util.Assert; -import org.springframework.util.ClassUtils; import com.nis.domain.Page; import com.nis.domain.configuration.AreaIpCfg; -import com.nis.domain.configuration.AvFileSampleCfg; -import com.nis.domain.configuration.AvSignSampleCfg; -import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.ComplexkeywordCfg; @@ -33,6 +21,7 @@ import com.nis.domain.configuration.HttpReqHeadCfg; import com.nis.domain.configuration.HttpResHeadCfg; import com.nis.domain.configuration.HttpUrlCfg; import com.nis.domain.configuration.IpPortCfg; +import com.nis.domain.configuration.NtcSubscribeIdCfg; import com.nis.domain.configuration.SslKeywordCfg; import com.nis.domain.maat.MaatCfg; import com.nis.domain.maat.MaatCfg.NumBoundaryCfg; @@ -46,14 +35,11 @@ import com.nis.exceptions.MaatConvertException; import com.nis.util.ConfigServiceUtil; import com.nis.util.Constants; import com.nis.util.DictUtils; -import com.nis.util.IpUtil; import com.nis.util.StringUtil; import com.nis.web.dao.configuration.AreaIpCfgDao; -import com.nis.web.dao.configuration.IpCfgDao; import com.nis.web.dao.configuration.StringCfgDao; import com.nis.web.dao.configuration.WebsiteCfgDao; import com.nis.web.security.UserUtils; -import com.nis.web.service.BaseService; import com.nis.web.service.CrudService; /** @@ -67,6 +53,8 @@ public class WebsiteCfgService extends CrudService { protected WebsiteCfgDao websiteCfgDao; @Autowired protected AreaIpCfgDao areaIpCfgDao; + @Autowired + protected StringCfgDao stringCfgDao; public CfgIndexInfo getHttpCfg(Long cfgId){ CfgIndexInfo entity = websiteCfgDao.getCfgIndexInfo(cfgId); @@ -74,6 +62,7 @@ public class WebsiteCfgService extends CrudService { List httpUrlList = websiteCfgDao.getHttpUrlList(entity); List httpReqHdrList = websiteCfgDao.getHttpReqHdrList(entity); List httpResHdrList = websiteCfgDao.getHttpResHdrList(entity); + List subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity); entity.setCfgType(Constants.HTTP_REQ_BODY_REGION); List httpReqBodyList = websiteCfgDao.getHttpReqBodyList(entity); entity.setCfgType(Constants.HTTP_RES_BODY_REGION); @@ -84,13 +73,16 @@ public class WebsiteCfgService extends CrudService { entity.setHttpResBodyList(httpResBodyList); entity.setHttpResHdrList(httpResHdrList); entity.setHttpUrlList(httpUrlList); + entity.setNtcSubscribeIdCfgList(subscribeIdList); return entity; } public CfgIndexInfo getSslCfg(Long cfgId){ CfgIndexInfo entity = websiteCfgDao.getCfgIndexInfo(cfgId); List ipPortList = websiteCfgDao.getIpPortList(entity); List sslList = websiteCfgDao.getSslKewordList(entity); + List subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity); entity.setIpPortList(ipPortList); + entity.setNtcSubscribeIdCfgList(subscribeIdList); entity.setSslList(sslList); return entity; } @@ -98,8 +90,10 @@ public class WebsiteCfgService extends CrudService { CfgIndexInfo entity = websiteCfgDao.getCfgIndexInfo(cfgId); List ipPortList = websiteCfgDao.getIpPortList(entity); List domainList = websiteCfgDao.getDnsDomainList(entity); + List subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity); entity.setIpPortList(ipPortList); entity.setDomainList(domainList); + entity.setNtcSubscribeIdCfgList(subscribeIdList); return entity; } public Page getWebsiteList(Page page, CfgIndexInfo entity){ @@ -113,6 +107,10 @@ public class WebsiteCfgService extends CrudService { public void saveHttpCfg(CfgIndexInfo entity){ //设置区域运营商信息 setAreaEffectiveIds(entity); + + entity.setIsValid(0); + entity.setIsAudit(0); + if(entity.getCfgId()==null){ Integer compileId = 0; try { @@ -120,64 +118,69 @@ public class WebsiteCfgService extends CrudService { if(idList!=null && idList.size()>0){ compileId = idList.get(0); } - entity.setCompileId(compileId); - entity.setCreateTime(new Date()); - entity.setCreatorId(entity.getCurrentUser().getId()); - websiteCfgDao.saveCfgIndex(entity); - if(entity.getIpPortList()!=null){ - for(IpPortCfg cfg:entity.getIpPortList()){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - websiteCfgDao.saveIpPortCfg(cfg); - } - } - if(entity.getHttpUrlList()!=null){ - for(HttpUrlCfg cfg:entity.getHttpUrlList()){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - websiteCfgDao.saveHttpUrlCfg(cfg); - } - } - if(entity.getHttpReqHdrList()!=null){ - for(HttpReqHeadCfg cfg:entity.getHttpReqHdrList()){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){ - cfg.setDistrict(cfg.getDistrictShowName()); - } - websiteCfgDao.saveHttpReqHdrCfg(cfg); - } - } - if(entity.getHttpResHdrList()!=null){ - for(HttpResHeadCfg cfg:entity.getHttpResHdrList()){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){ - cfg.setDistrict(cfg.getDistrictShowName()); - } - websiteCfgDao.saveHttpResHdrCfg(cfg); - } - } - if(entity.getHttpReqBodyList()!=null){ - for(HttpBodyCfg cfg:entity.getHttpReqBodyList()){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - websiteCfgDao.saveHttpBodyCfg(cfg); - } - } - if(entity.getHttpResBodyList()!=null){ - for(HttpBodyCfg cfg:entity.getHttpResBodyList()){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - websiteCfgDao.saveHttpBodyCfg(cfg); - } - } - //保存区域IP信息 - if(entity.getAreaCfg()!=null){ - for(AreaIpCfg cfg:entity.getAreaCfg()){ - cfg.initDefaultValue(); - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - areaIpCfgDao.saveAreaIpCfg(cfg); - } - } - } catch (Exception e) { - e.printStackTrace(); + } catch (MaatConvertException e) { logger.info("获取编译ID出错"); - throw new MaatConvertException(":"+e.getMessage()); + throw new MaatConvertException(""); + } + entity.setCompileId(compileId); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + websiteCfgDao.saveCfgIndex(entity); + if(entity.getIpPortList()!=null){ + for(IpPortCfg cfg:entity.getIpPortList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + websiteCfgDao.saveIpPortCfg(cfg); + } + } + if(entity.getHttpUrlList()!=null){ + for(HttpUrlCfg cfg:entity.getHttpUrlList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + websiteCfgDao.saveHttpUrlCfg(cfg); + } + } + if(entity.getHttpReqHdrList()!=null){ + for(HttpReqHeadCfg cfg:entity.getHttpReqHdrList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){ + cfg.setDistrict(cfg.getDistrictShowName()); + } + websiteCfgDao.saveHttpReqHdrCfg(cfg); + } + } + if(entity.getHttpResHdrList()!=null){ + for(HttpResHeadCfg cfg:entity.getHttpResHdrList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){ + cfg.setDistrict(cfg.getDistrictShowName()); + } + websiteCfgDao.saveHttpResHdrCfg(cfg); + } + } + if(entity.getHttpReqBodyList()!=null){ + for(HttpBodyCfg cfg:entity.getHttpReqBodyList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + websiteCfgDao.saveHttpBodyCfg(cfg); + } + } + if(entity.getHttpResBodyList()!=null){ + for(HttpBodyCfg cfg:entity.getHttpResBodyList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + websiteCfgDao.saveHttpBodyCfg(cfg); + } + } + if(entity.getNtcSubscribeIdCfgList()!=null){ + for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + stringCfgDao.saveSubscribeIdCfg(cfg); + } + } + //保存区域IP信息 + if(entity.getAreaCfg()!=null){ + for(AreaIpCfg cfg:entity.getAreaCfg()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } } }else{ @@ -188,6 +191,7 @@ public class WebsiteCfgService extends CrudService { websiteCfgDao.deleteHttpReqHdrCfg(entity); websiteCfgDao.deleteHttpResHdrCfg(entity); websiteCfgDao.deleteHttpBodyCfg(entity); + stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity); AreaIpCfg area = new AreaIpCfg(); area.setCompileId(entity.getCompileId()); area.setFunctionId(entity.getFunctionId()); @@ -236,6 +240,12 @@ public class WebsiteCfgService extends CrudService { websiteCfgDao.saveHttpBodyCfg(cfg); } } + if(entity.getNtcSubscribeIdCfgList()!=null){ + for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + stringCfgDao.saveSubscribeIdCfg(cfg); + } + } //保存区域IP信息 if(entity.getAreaCfg()!=null){ for(AreaIpCfg cfg:entity.getAreaCfg()){ @@ -290,6 +300,12 @@ public class WebsiteCfgService extends CrudService { cfg.setTableName(HttpBodyCfg.getTablename()); websiteCfgDao.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()); + websiteCfgDao.updateCfgValid(cfg); + } //保存区域IP信息 if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ AreaIpCfg cfg = new AreaIpCfg(); @@ -384,6 +400,17 @@ public class WebsiteCfgService 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()); + websiteCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + } //保存区域IP信息 List areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); if(!StringUtil.isEmpty(areaIpCfgList)){ @@ -482,6 +509,10 @@ public class WebsiteCfgService extends CrudService { public void saveSslCfg(CfgIndexInfo entity){ //设置区域运营商信息 setAreaEffectiveIds(entity); + + entity.setIsValid(0); + entity.setIsAudit(0); + if(entity.getCfgId()==null){ Integer compileId = 0; try { @@ -489,36 +520,43 @@ public class WebsiteCfgService extends CrudService { if(idList!=null && idList.size()>0){ compileId = idList.get(0); } - entity.setCompileId(compileId); - entity.setCreateTime(new Date()); - entity.setCreatorId(entity.getCurrentUser().getId()); - websiteCfgDao.saveCfgIndex(entity); - if(entity.getIpPortList()!=null){ - for(IpPortCfg cfg:entity.getIpPortList()){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - websiteCfgDao.saveIpPortCfg(cfg); - } - } - if(entity.getSslList()!=null){ - for(BaseStringCfg cfg:entity.getSslList()){ - if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - websiteCfgDao.saveSslKeywordCfg(cfg); - } - } - } - //保存区域IP信息 - if(entity.getAreaCfg()!=null){ - for(AreaIpCfg cfg:entity.getAreaCfg()){ - cfg.initDefaultValue(); - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - areaIpCfgDao.saveAreaIpCfg(cfg); - } - } - } catch (Exception e) { - e.printStackTrace(); + } catch (MaatConvertException e) { logger.info("获取编译ID出错"); - throw new MaatConvertException(":"+e.getMessage()); + throw new MaatConvertException(""); + } + entity.setCompileId(compileId); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + websiteCfgDao.saveCfgIndex(entity); + if(entity.getIpPortList()!=null){ + for(IpPortCfg cfg:entity.getIpPortList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + websiteCfgDao.saveIpPortCfg(cfg); + } + } + if(entity.getSslList()!=null){ + for(BaseStringCfg cfg:entity.getSslList()){ + if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + websiteCfgDao.saveSslKeywordCfg(cfg); + } + } + } + if(entity.getSslList()!=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()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } } }else{ @@ -526,6 +564,7 @@ public class WebsiteCfgService extends CrudService { //无效子配置后,再新增子配置 websiteCfgDao.deleteSslIpCfg(entity); websiteCfgDao.deleteSslKeywordCfg(entity); + stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity); AreaIpCfg area = new AreaIpCfg(); area.setCompileId(entity.getCompileId()); area.setFunctionId(entity.getFunctionId()); @@ -546,6 +585,14 @@ public class WebsiteCfgService extends CrudService { } } } + 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()){ @@ -582,6 +629,13 @@ public class WebsiteCfgService extends CrudService { cfg.setTableName(SslKeywordCfg.getTablename()); websiteCfgDao.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()); + websiteCfgDao.updateCfgValid(cfg); + } //保存区域IP信息 if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ AreaIpCfg cfg = new AreaIpCfg(); @@ -635,6 +689,17 @@ public class WebsiteCfgService extends CrudService { strRegionList=map.get("dstList"); } } + if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){ + NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(NtcSubscribeIdCfg.getTablename()); + websiteCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + } //保存区域IP信息 List areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); if(!StringUtil.isEmpty(areaIpCfgList)){ @@ -703,6 +768,10 @@ public class WebsiteCfgService extends CrudService { public void saveDnsCfg(CfgIndexInfo entity){ //设置区域运营商信息 setAreaEffectiveIds(entity); + + entity.setIsValid(0); + entity.setIsAudit(0); + if(entity.getCfgId()==null){ Integer compileId = 0; try { @@ -710,39 +779,46 @@ public class WebsiteCfgService extends CrudService { if(idList!=null && idList.size()>0){ compileId = idList.get(0); } - entity.setCompileId(compileId); - entity.setCreateTime(new Date()); - entity.setCreatorId(entity.getCurrentUser().getId()); - websiteCfgDao.saveCfgIndex(entity); - if(entity.getIpPortList()!=null){ - for(IpPortCfg cfg:entity.getIpPortList()){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - websiteCfgDao.saveIpPortCfg(cfg); - } - } - if(entity.getDomainList()!=null){ - for(ComplexkeywordCfg cfg:entity.getDomainList()){ - if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){ - cfg.setDistrict(cfg.getDistrictShowName()); - } - websiteCfgDao.saveDnsDomainCfg(cfg); - } - } - } - //保存区域IP信息 - if(entity.getAreaCfg()!=null){ - for(AreaIpCfg cfg:entity.getAreaCfg()){ - cfg.initDefaultValue(); - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - areaIpCfgDao.saveAreaIpCfg(cfg); - } - } - } catch (Exception e) { - e.printStackTrace(); + } catch (MaatConvertException e) { logger.info("获取编译ID出错"); - throw new MaatConvertException(":"+e.getMessage()); + throw new MaatConvertException(""); + } + entity.setCompileId(compileId); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + websiteCfgDao.saveCfgIndex(entity); + if(entity.getIpPortList()!=null){ + for(IpPortCfg cfg:entity.getIpPortList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + websiteCfgDao.saveIpPortCfg(cfg); + } + } + if(entity.getDomainList()!=null){ + for(ComplexkeywordCfg cfg:entity.getDomainList()){ + if(StringUtils.isNotBlank(cfg.getCfgKeywords())){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + if(StringUtils.isNoneBlank(cfg.getDistrictShowName()) && cfg.getDistrict().equals("others")){ + cfg.setDistrict(cfg.getDistrictShowName()); + } + websiteCfgDao.saveDnsDomainCfg(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()){ + cfg.initDefaultValue(); + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + areaIpCfgDao.saveAreaIpCfg(cfg); + } } }else{ @@ -750,6 +826,7 @@ public class WebsiteCfgService extends CrudService { //无效子配置后,再新增子配置 websiteCfgDao.deleteDnsIpCfg(entity); websiteCfgDao.deleteDnsDomainCfg(entity); + stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity); AreaIpCfg area = new AreaIpCfg(); area.setCompileId(entity.getCompileId()); area.setFunctionId(entity.getFunctionId()); @@ -773,6 +850,14 @@ public class WebsiteCfgService extends CrudService { } } } + 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()){ @@ -810,11 +895,18 @@ public class WebsiteCfgService extends CrudService { } if(entity.getDomainList()!=null && entity.getDomainList().size()>0) { - SslKeywordCfg cfg = new SslKeywordCfg(); + DnsDomainCfg cfg = new DnsDomainCfg(); BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); cfg.setTableName(DnsDomainCfg.getTablename()); websiteCfgDao.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()); + websiteCfgDao.updateCfgValid(cfg); + } //保存区域IP信息 if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ AreaIpCfg cfg = new AreaIpCfg(); @@ -874,6 +966,17 @@ public class WebsiteCfgService extends CrudService { strRegionList=map.get("dstList"); } } + if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){ + NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(NtcSubscribeIdCfg.getTablename()); + websiteCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList); + groupRelationList=map.get("groupList"); + strRegionList=map.get("dstList"); + } + } //保存区域IP信息 List areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId()); if(!StringUtil.isEmpty(areaIpCfgList)){ diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index 9ec763708..2a7dd1c5f 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -443,7 +443,7 @@ specific_service_cfg_type_basic_protocol=basic_protocol proto_id_region=PROTO_ID #拦截IP自定义域key keyring_id=keyring_id -droprate=Droprate +droprate=DROPRATE bandwidth=Bandwidth #IP\u9ed8\u8ba4\u503c ipv4_default_ip_value=\:\: diff --git a/src/main/resources/sql/add_function_region.sql b/src/main/resources/sql/add_function_region.sql new file mode 100644 index 000000000..d4e7b16f6 --- /dev/null +++ b/src/main/resources/sql/add_function_region.sql @@ -0,0 +1,19 @@ +INSERT INTO function_region_dict + () +VALUES + ('subscribe_id', '0', '0,1', '0,1,2', '0,1,2,3', 174, 34, 2, 'NTC_SUBSCRIBE_ID', '', 'SSL SUBSCRIBE_ID配置', 1, NULL, NULL, NULL, NULL, 1, 2, '', '', '', '', '', '', 3); + +INSERT INTO function_region_dict + () +VALUES + ('subscribe_id', '0', '0,1', '0,1,2', '0,1,2,3', 175, 7, 2, 'NTC_SUBSCRIBE_ID', '', 'DNS SUBSCRIBE_ID配置', 1, NULL, NULL, NULL, NULL, 1, 2, '', '', '', '', '', '', 5); + +INSERT INTO function_region_dict + () +VALUES + ('subscribe_id', '0', '0,1', '0,1,2', '0,1,2,3', 176, 35, 3, 'NTC_SUBSCRIBE_ID', '', '邮件 SUBSCRIBE_ID配置', 1, NULL, NULL,NULL , NULL, 1, 2, '', '', '', '', '', '', 7); + +INSERT INTO function_region_dict + () +VALUES + ('subscribe_id', '0', '0,1', '0,1,2', '0,1,2,3', 177, 8, 3, 'NTC_SUBSCRIBE_ID', '', 'HTTP SUBSCRIBE_ID配置', 1, NULL, NULL,NULL , NULL, 1, 3, '', '', '', '', '', '', 7); \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptIpForm.jsp b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptIpForm.jsp index 0895aee36..9ddfc1d19 100644 --- a/src/main/webapp/WEB-INF/views/cfg/intercept/interceptIpForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/intercept/interceptIpForm.jsp @@ -16,6 +16,13 @@ $("#cancel").on("click", function() { window.history.back(); }); + + $(".action").on("change", function() { + //拦截根据action切换动作部分 + setInterceptDefaultInfo(""); + $("#serviceId").val($(this).attr("serviceId")); + $("#protocolId").val($(this).attr("protocolId")); + }); $("#serviceId").val($(".action:checked").attr("serviceId")); $("#protocolId").val($(".action:checked").attr("protocolId")); $("#cfgFrom").validate( diff --git a/src/main/webapp/WEB-INF/views/cfg/mail/mailSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/mail/mailSubList.jsp index fe33fdfd3..34229a3a5 100644 --- a/src/main/webapp/WEB-INF/views/cfg/mail/mailSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/mail/mailSubList.jsp @@ -229,5 +229,60 @@ + + + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/website/dnsSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/dnsSubList.jsp index 3a9f4effa..ae10f6ef1 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/dnsSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/dnsSubList.jsp @@ -184,5 +184,60 @@ + + + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp index 677cbd532..7bad1eed4 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/httpList.jsp @@ -9,6 +9,8 @@ //搜索框提示语初始化 if("${cfg.cfgDesc}"){ $("#intype").val("${cfg.cfgDesc}"); + }else if("${cfg.compileId}"){ + $("#intype").val("${cfg.compileId}"); }else{ $("#intype").attr("placeholder"," "+$("#seltype").find("option:selected").text()); } @@ -289,6 +291,7 @@ + <%-- @@ -363,7 +366,7 @@ - +
diff --git a/src/main/webapp/WEB-INF/views/cfg/website/httpSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/httpSubList.jsp index 6b1cef82f..894572091 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/httpSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/httpSubList.jsp @@ -53,6 +53,13 @@
+ +
+ + +
+
@@ -409,6 +416,55 @@ + + +
+
+
+
+ +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/website/sslSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/website/sslSubList.jsp index 0fe9e1429..1eebb9e1c 100644 --- a/src/main/webapp/WEB-INF/views/cfg/website/sslSubList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/website/sslSubList.jsp @@ -120,7 +120,7 @@ - +
@@ -172,5 +172,57 @@ + + + +
+
+
+
+ +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+
+
\ No newline at end of file From 38d9da269378c676c6efde012998620e581ae8d3 Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Thu, 23 Aug 2018 10:08:55 +0800 Subject: [PATCH 04/11] =?UTF-8?q?APP=E7=AD=96=E7=95=A5=E3=80=81=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=91=98=E8=A6=81doLog=20CompileId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ntc/FileTransferCfgController.java | 2 + .../nis/web/dao/configuration/AppCfgDao.xml | 2 +- .../dao/configuration/FileTransferCfgDao.xml | 6 +- .../nis/web/dao/configuration/MailCfgDao.xml | 6 +- .../configuration/FileTransferCfgService.java | 35 +- .../views/cfg/app/appPolicyCfgForm.jsp | 23 +- .../views/cfg/app/appPolicyCfgList.jsp | 11 + .../views/cfg/fileTransfer/fileDigestForm.jsp | 332 ++++++++++-------- .../views/cfg/fileTransfer/fileDigestList.jsp | 12 +- .../views/cfg/fileTransfer/p2pList.jsp | 7 +- 10 files changed, 267 insertions(+), 169 deletions(-) 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 09480a13f..491dff836 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 @@ -248,6 +248,8 @@ public class FileTransferCfgController extends BaseController{ logger.info("获取文件摘要响应信息:"+result); } fileTransferCfgService.saveOrUpdateFileDigestCfg(entity,result,areaCfgIds); + } catch (MaatConvertException e) { + addMessage(redirectAttributes, e.getMessage()); } catch (IOException e) { e.printStackTrace(); } 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 145b590cd..e22ed5d00 100644 --- a/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AppCfgDao.xml @@ -300,7 +300,7 @@ 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.EXPR_TYPE,r.MATCH_METHOD,r.IS_HEXBIN,r.USER_REGION1,r.USER_REGION2, - r.USER_REGION3,r.USER_REGION4,r.USER_REGION5,r.do_log + r.USER_REGION3,r.USER_REGION4,r.USER_REGION5,r.DO_LOG 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 4b7770a43..9140f8307 100644 --- a/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/FileTransferCfgDao.xml @@ -121,6 +121,7 @@ + @@ -187,7 +188,7 @@ a.CFG_ID,a.CFG_DESC,a.raw_len,a.digest,a.cfds_level,a.file_url,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.SERVICE_ID,a.REQUEST_ID,a.COMPILE_ID,a.IS_AREA_EFFECTIVE,a.CLASSIFY,a.DO_LOG, a.ATTRIBUTE,a.LABLE,a.AREA_EFFECTIVE_IDS,a.function_id,cfg_type,cfg_region_code - - - - - - - - - - -
-
-
-
- -
- -
-
-
-
-
- -
- - - -
-
-
-
-
-
-
-
- -
- +
+ +
+ + + + + + + + + + + +
+
+
+
+ +
+ +
+
+
+
+
+ +
+ + + +
+
+
+
+
+
+
+
+ +
+
- " class="required form-control" style=" background-color:transparent" - aria-required="true" type="text" value="${_cfg.digest }"> - + " + class="required form-control" + style="background-color: transparent" aria-required="true" + type="text" value="${_cfg.digest }"> +
- +
-
- +
+ +
+
+
+
+
+
+ +
+ +
+
+
+
+ +
+
+
+
+ + + + + + + + + + +
-
-
-
- -
- -
-
-
-
- + <%@include file="/WEB-INF/include/form/areaInfo.jsp"%> + <%@include file="/WEB-INF/include/form/basicInfo.jsp"%>
- <%@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/fileTransfer/fileDigestList.jsp b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/fileDigestList.jsp index 11593a8b3..e2c89c8ae 100644 --- a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/fileDigestList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/fileDigestList.jsp @@ -12,6 +12,8 @@ $("#intype").val("${cfg.cfgDesc}"); }else if("${cfg.cfdsLevel}"){ $("#intype").val("${cfg.cfdsLevel}"); + }else if("${cfg.compileId}"){ + $("#intype").val("${cfg.compileId}"); }else{ $("#intype").attr("placeholder"," "+$("#seltype").find("option:selected").text()); } @@ -59,7 +61,6 @@
- @@ -89,6 +90,7 @@ + @@ -271,6 +273,7 @@ + @@ -377,6 +380,13 @@ ${fns:abbr(lableInfo,20)} + + + + + + + diff --git a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pList.jsp b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pList.jsp index d6bfc4719..e5a0e0d68 100644 --- a/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pList.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/fileTransfer/p2pList.jsp @@ -9,6 +9,8 @@ //搜索框提示语初始化 if("${cfg.cfgDesc}"){ $("#intype").val("${cfg.cfgDesc}"); + }else if("${cfg.compileId}"){ + $("#intype").val("${cfg.compileId}"); }else{ $("#intype").attr("placeholder"," "+$("#seltype").find("option:selected").text()); } @@ -131,10 +133,7 @@ - <%-- - - - --%> +
From 4639fe0fdb02d5f25ab905355a3809d5f9ca40a1 Mon Sep 17 00:00:00 2001 From: zhangwenqing Date: Thu, 23 Aug 2018 10:28:29 +0800 Subject: [PATCH 05/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9findSubscribeIdCfgList(?= =?UTF-8?q?)=20xml.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml index 2d375284e..af9281a06 100644 --- a/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml @@ -517,8 +517,8 @@ from ntc_subscribe_id_cfg r - - and r.FUNCTION_ID=#{fucntionId,jdbcType=INTEGER} + + and r.FUNCTION_ID=#{functionId,jdbcType=INTEGER} and r.COMPILE_ID=#{compileId,jdbcType=INTEGER} From 8b922425811549fe2eb1c995c361528e193ea7b1 Mon Sep 17 00:00:00 2001 From: wangxin Date: Thu, 23 Aug 2018 10:36:53 +0800 Subject: [PATCH 06/11] =?UTF-8?q?serviceId=E4=B8=BA1057,1058=E7=9A=84funct?= =?UTF-8?q?ion=5Fid=E4=B8=BA302,303=E7=9A=84=E8=8F=9C=E5=8D=95=E9=9A=90?= =?UTF-8?q?=E8=97=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/sql/update_ip_domain_ratelimit_invalid.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 src/main/resources/sql/update_ip_domain_ratelimit_invalid.sql diff --git a/src/main/resources/sql/update_ip_domain_ratelimit_invalid.sql b/src/main/resources/sql/update_ip_domain_ratelimit_invalid.sql new file mode 100644 index 000000000..25c5ff8af --- /dev/null +++ b/src/main/resources/sql/update_ip_domain_ratelimit_invalid.sql @@ -0,0 +1,2 @@ +UPDATE function_service_dict SET is_valid=0 WHERE service_id IN (1057,1058) +UPDATE sys_menu SET del_flag=0 WHERE function_id IN (302,303) \ No newline at end of file From 6b89fcae499015e04a65f088334f5998c06de160 Mon Sep 17 00:00:00 2001 From: duandongmei Date: Thu, 23 Aug 2018 11:04:43 +0800 Subject: [PATCH 07/11] =?UTF-8?q?functionId=E5=90=8D=E7=A7=B0=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml index 2d375284e..af9281a06 100644 --- a/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/StringCfgDao.xml @@ -517,8 +517,8 @@ from ntc_subscribe_id_cfg r - - and r.FUNCTION_ID=#{fucntionId,jdbcType=INTEGER} + + and r.FUNCTION_ID=#{functionId,jdbcType=INTEGER} and r.COMPILE_ID=#{compileId,jdbcType=INTEGER} From 78b35d49b2dde7c63096cf2dc4243d17b0a87d8f Mon Sep 17 00:00:00 2001 From: duandongmei Date: Thu, 23 Aug 2018 11:07:29 +0800 Subject: [PATCH 08/11] =?UTF-8?q?dns\ssl\mail\http=E4=BF=AE=E6=94=B9subscr?= =?UTF-8?q?ibeId=E4=B8=8D=E5=85=81=E8=AE=B8=E5=8D=95=E7=8B=AC=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../configuration/ntc/WebsiteController.java | 6 ++---- src/main/resources/nis.properties | 2 +- src/main/webapp/WEB-INF/views/cfg/mail/mailForm.jsp | 13 +++++++++---- .../webapp/WEB-INF/views/cfg/website/dnsForm.jsp | 13 +++++++++---- .../webapp/WEB-INF/views/cfg/website/httpForm.jsp | 7 ++++--- .../webapp/WEB-INF/views/cfg/website/sslForm.jsp | 13 +++++++++---- 6 files changed, 34 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java index 2f58cd72e..95d747420 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/WebsiteController.java @@ -99,11 +99,9 @@ public class WebsiteController extends BaseController{ int httpReqCfgNum = entity.getIpPortList().size()+ entity.getHttpUrlList().size()+ entity.getHttpReqBodyList().size()+ - entity.getHttpReqHdrList().size()+ - entity.getNtcSubscribeIdCfgList().size(); + entity.getHttpReqHdrList().size(); int httpResCfgNum = entity.getHttpResHdrList().size()+ - entity.getHttpResBodyList().size()+ - entity.getNtcSubscribeIdCfgList().size(); + entity.getHttpResBodyList().size(); model.addAttribute("httpReqCfgNum", httpReqCfgNum); model.addAttribute("httpResCfgNum", httpResCfgNum); if(entity.getIpPortList().size()==0){ diff --git a/src/main/resources/nis.properties b/src/main/resources/nis.properties index 2a7dd1c5f..9ec763708 100644 --- a/src/main/resources/nis.properties +++ b/src/main/resources/nis.properties @@ -443,7 +443,7 @@ specific_service_cfg_type_basic_protocol=basic_protocol proto_id_region=PROTO_ID #拦截IP自定义域key keyring_id=keyring_id -droprate=DROPRATE +droprate=Droprate bandwidth=Bandwidth #IP\u9ed8\u8ba4\u503c ipv4_default_ip_value=\:\: diff --git a/src/main/webapp/WEB-INF/views/cfg/mail/mailForm.jsp b/src/main/webapp/WEB-INF/views/cfg/mail/mailForm.jsp index ddc89112c..8a6a745ea 100644 --- a/src/main/webapp/WEB-INF/views/cfg/mail/mailForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/mail/mailForm.jsp @@ -40,8 +40,13 @@ submitHandler : function(form) { var flag = true; + var subscribeId=0; + //存在隐藏的subscribeId,不算进域配置 + if($(".boxSolid.hidden").hasClass("subscribeId")){ + subscribeId=1; + } //代表所有业务都隐藏了,提示必须增加一种业务数据 - if($(".boxSolid").length ==$(".boxSolid.hidden").length){ + if(($(".boxSolid").length-1) ==($(".boxSolid.hidden").length-subscribeId)){ top.$.jBox.tip("", ""); return; } @@ -311,7 +316,7 @@ -
+
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
@@ -320,14 +325,14 @@ -