diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index 0b4ed2377..4e8b8c4a3 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -69,6 +69,7 @@ import com.nis.web.service.configuration.NumCfgService; import com.nis.web.service.configuration.RequestInfoService; import com.nis.web.service.configuration.StringCfgService; import com.nis.web.service.configuration.WebsiteCfgService; +import com.nis.web.service.configuration.XmppCfgService; import com.nis.web.service.specific.SpecificServiceCfgService; import com.nis.web.service.specific.SpecificServiceHostCfgService; import com.nis.web.service.systemService.ServiceConfigInfoService; @@ -149,6 +150,8 @@ public class BaseController { protected WebsiteCfgService websiteCfgService; @Autowired protected BgpCfgService bgpCfgService; + @Autowired + protected XmppCfgService xmppCfgService; /** * 管理基础路径 */ 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 new file mode 100644 index 000000000..e142eac1f --- /dev/null +++ b/src/main/java/com/nis/web/controller/configuration/ntc/XmppController.java @@ -0,0 +1,118 @@ +/** + *@Title: XmppController.java + *@Package com.nis.web.controller.configuration.ntc + *@Description TODO + *@author dell + *@date 2018年6月12日 下午3:04:17 + *@version 版本号 + */ +package com.nis.web.controller.configuration.ntc; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang3.StringUtils; +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +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.exceptions.MaatConvertException; +import com.nis.web.controller.BaseController; +import com.nis.web.security.UserUtils; + +/** + * @ClassName: XmppController.java + * @Description: TODO + * @author (dell) + * @date 2018年6月12日 下午3:04:17 + * @version V1.0 + */ +@Controller +@RequestMapping("${adminPath}/ntc/other") +public class XmppController extends BaseController { + @RequestMapping(value = {"xmppList"}) + @RequiresPermissions(value={"other:xmpp:config","other:xmpp:audit"},logical=Logical.OR) + public String list(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) { + Page searchPage=new Page(request,response,"a"); + Page page = xmppCfgService.getXmppList(searchPage, cfg); + model.addAttribute("page", page); + initPageCondition(model,cfg); + return "/cfg/other/xmppList"; + } + @RequestMapping(value = {"xmppForm"}) + @RequiresPermissions(value={"other:xmpp:config"}) + public String form(Model model,String ids,CfgIndexInfo entity) { + if(StringUtils.isNotBlank(ids)){ + entity = xmppCfgService.getXmppCfg(Long.parseLong(ids)); + initUpdateFormCondition(model,entity); + }else{ + initFormCondition(model,entity); + } + + model.addAttribute("_cfg", entity); + return "/cfg/other/xmppForm"; + } + @RequestMapping(value = {"updateXmppCfgValid"}) + @RequiresPermissions(value={"other:xmpp:config"}) + public String updateXmppCfgValid(Integer isValid,String ids,Integer functionId) { + websiteCfgService.updateHttpCfgValid(isValid,ids,functionId); + return "redirect:" + adminPath +"/ntc/other/xmppList?functionId="+functionId; + } + @RequestMapping(value = {"auditXmppCfg"}) + @RequiresPermissions(value={"other:xmpp:config"}) + public String auditXmppCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) { + CfgIndexInfo entity = new CfgIndexInfo(); + String[] idArray = ids.split(","); + for(String id :idArray){ + entity = xmppCfgService.getXmppCfg(Long.parseLong(id)); + entity.setIsAudit(isAudit); + entity.setIsValid(isValid); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); + entity.setFunctionId(functionId); + try { + xmppCfgService.auditXmppCfg(entity,isAudit); + } catch (MaatConvertException e) { + e.printStackTrace(); + logger.info("http配置下发失败:"+e.getMessage()); + addMessage(redirectAttributes, e.getMessage()); + } + } + return "redirect:" + adminPath +"/ntc/other/xmppList?functionId="+functionId; + } + @RequestMapping(value = {"ajaxXmppSubList"}) + public String ajaxXmppSubList(Model model,Long cfgId,Integer index) { + CfgIndexInfo cfg = xmppCfgService.getXmppCfg(cfgId); + List tabList = new ArrayList(); + if(cfg.getIpPortList()!=null){ + String cfgType = null; + for(IpPortCfg ip:cfg.getIpPortList()){ + if(!ip.getCfgType().equals(cfgType)){ + tabList.add(new String[]{"1",ip.getCfgType()}); + cfgType = ip.getCfgType(); + } + } + } + model.addAttribute("_cfg", cfg); + model.addAttribute("index", index); + model.addAttribute("tabList", tabList); + return "/cfg/other/xmppSubList"; + } + @RequestMapping(value = {"saveXmppCfg"}) + @RequiresPermissions(value={"other:xmpp:config"}) + public String saveXmppCfg(Model model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) { + xmppCfgService.saveXmppCfg(entity); + return "redirect:" + adminPath +"/ntc/other/xmppList?functionId="+entity.getFunctionId(); + } +} diff --git a/src/main/java/com/nis/web/dao/configuration/XmppCfgDao.java b/src/main/java/com/nis/web/dao/configuration/XmppCfgDao.java new file mode 100644 index 000000000..371e033fb --- /dev/null +++ b/src/main/java/com/nis/web/dao/configuration/XmppCfgDao.java @@ -0,0 +1,39 @@ +package com.nis.web.dao.configuration; + +import java.util.List; + +import com.nis.domain.configuration.AvFileSampleCfg; +import com.nis.domain.configuration.AvSignSampleCfg; +import com.nis.domain.configuration.BaseCfg; +import com.nis.domain.configuration.BaseStringCfg; +import com.nis.domain.configuration.CfgIndexInfo; +import com.nis.domain.configuration.ComplexkeywordCfg; +import com.nis.domain.configuration.DnsDomainCfg; +import com.nis.domain.configuration.DnsIpCfg; +import com.nis.domain.configuration.HttpBodyCfg; +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.SslKeywordCfg; +import com.nis.web.dao.CrudDao; +import com.nis.web.dao.MyBatisDao; + + +/** + * WEB相关配置数据处理类 + * @author dell + * + */ +@MyBatisDao +public interface XmppCfgDao extends CrudDao{ + public CfgIndexInfo getCfgIndexInfo(Long id); + public List getXmppList(CfgIndexInfo entity); + public List getIpPortList(CfgIndexInfo entity); + public void saveCfgIndex(CfgIndexInfo entity); + public void saveIpPortCfg(IpPortCfg entity); + public void updateCfgIndex(CfgIndexInfo entity); + public void updateCfgValid(BaseCfg entity); + public void auditCfg(BaseCfg entity); + public void deleteXmppIpCfg(BaseCfg entity); +} diff --git a/src/main/java/com/nis/web/dao/configuration/XmppCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/XmppCfgDao.xml new file mode 100644 index 000000000..2b2e7be0f --- /dev/null +++ b/src/main/java/com/nis/web/dao/configuration/XmppCfgDao.xml @@ -0,0 +1,607 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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.cfg_id,a.cfg_desc,a.ip_type,a.src_ip_address,a.ip_pattern,a.port_pattern,a.src_port + ,a.protocol,a.protocol_id,a.direction,a.cfg_type,a.action,a.dest_port,a.dest_ip_address + ,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.cfg_region_code + + + a.cfg_id,a.cfg_desc,a.cfg_keywords,a.cfg_type, + 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.expr_type,a.match_method,a.is_hexbin,a.area_effective_ids,a.function_id,a.cfg_region_code + + + a.cfg_id,a.cfg_desc,a.cfg_keywords,a.cfg_type,a.district, + 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.expr_type,a.match_method,a.is_hexbin,a.area_effective_ids,a.function_id,a.cfg_region_code + + + + + + + + + + SELECT LAST_INSERT_ID() + + insert into cfg_index_info( + 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, + function_id + )values ( + #{cfgDesc,jdbcType=VARCHAR}, + #{action,jdbcType=INTEGER}, + 0, + 0, + #{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}, + #{functionId,jdbcType=INTEGER} + ) + + + + + SELECT LAST_INSERT_ID() + + insert into ip_port_cfg ( + 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, + function_id, + ip_type, + src_ip_address, + ip_pattern, + port_pattern, + src_port, + protocol, + protocol_id, + direction, + dest_port, + dest_ip_address, + cfg_type, + cfg_region_code + )values ( + #{cfgDesc,jdbcType=VARCHAR}, + #{action,jdbcType=INTEGER}, + 0, + 0, + #{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}, + #{functionId,jdbcType=INTEGER}, + #{ipType,jdbcType=INTEGER}, + #{srcIpAddress,jdbcType=VARCHAR}, + #{ipPattern,jdbcType=INTEGER}, + #{portPattern,jdbcType=INTEGER}, + #{srcPort,jdbcType=VARCHAR}, + #{protocol,jdbcType=INTEGER}, + #{protocolId,jdbcType=INTEGER}, + #{direction,jdbcType=INTEGER}, + #{destPort,jdbcType=VARCHAR}, + #{destIpAddress,jdbcType=VARCHAR}, + #{cfgType,jdbcType=VARCHAR}, + #{cfgRegionCode,jdbcType=INTEGER} + ) + + + + + + + update cfg_index_info + + + + cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, + + + 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}, + + service_id = #{serviceId,jdbcType=INTEGER}, + + + request_id = #{requestId,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}, + + + + where cfg_id = #{cfgId,jdbcType=BIGINT} + + + + delete from ip_port_cfg where compile_id=#{compileId} and protocol_id=16 and function_id=#{functionId} + + + update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER}, + editor_id = #{editorId,jdbcType=INTEGER} , + edit_time = #{editTime,jdbcType=TIMESTAMP} + + + AND cfg_id = #{cfgId,jdbcType=BIGINT} + + + AND compile_id = #{compileId,jdbcType=INTEGER} + + and function_id=#{functionId,jdbcType=INTEGER} + + + + update ${tableName} set is_audit = #{isAudit,jdbcType=INTEGER}, + auditor_id = #{auditorId,jdbcType=INTEGER}, + audit_time = #{auditTime,jdbcType=TIMESTAMP} + + ,is_valid = #{isValid,jdbcType=INTEGER} + + + + AND cfg_id = #{cfgId,jdbcType=BIGINT} + + + 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/XmppCfgService.java b/src/main/java/com/nis/web/service/configuration/XmppCfgService.java new file mode 100644 index 000000000..6ae84e56d --- /dev/null +++ b/src/main/java/com/nis/web/service/configuration/XmppCfgService.java @@ -0,0 +1,260 @@ +package com.nis.web.service.configuration; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; +import java.util.Map; + +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.nis.domain.Page; +import com.nis.domain.configuration.AreaIpCfg; +import com.nis.domain.configuration.CfgIndexInfo; +import com.nis.domain.configuration.ComplexkeywordCfg; +import com.nis.domain.configuration.IpPortCfg; +import com.nis.domain.maat.MaatCfg; +import com.nis.domain.maat.MaatCfg.DigestCfg; +import com.nis.domain.maat.MaatCfg.GroupCfg; +import com.nis.domain.maat.MaatCfg.IpCfg; +import com.nis.domain.maat.MaatCfg.NumBoundaryCfg; +import com.nis.domain.maat.MaatCfg.StringCfg; +import com.nis.domain.maat.ToMaatBean; +import com.nis.domain.maat.ToMaatResult; +import com.nis.exceptions.MaatConvertException; +import com.nis.util.ConfigServiceUtil; +import com.nis.util.Constants; +import com.nis.util.StringUtil; +import com.nis.web.dao.configuration.AreaIpCfgDao; +import com.nis.web.dao.configuration.XmppCfgDao; +import com.nis.web.security.UserUtils; +import com.nis.web.service.CrudService; + +/** + * xmpp相关配置事务类 + * @author dell + * + */ +@Service +public class XmppCfgService extends CrudService { + @Autowired + protected XmppCfgDao xmppCfgDao; + @Autowired + protected AreaIpCfgDao areaIpCfgDao; + + public CfgIndexInfo getXmppCfg(Long cfgId){ + CfgIndexInfo entity = xmppCfgDao.getCfgIndexInfo(cfgId); + List ipPortList = xmppCfgDao.getIpPortList(entity); + entity.setIpPortList(ipPortList); + return entity; + } + public Page getXmppList(Page page, CfgIndexInfo entity){ + // 生成数据权限过滤条件(dsf为dataScopeFilter的简写,在xml中使用 ${sqlMap.dsf}调用权限SQL) + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"a")); + entity.setPage(page); + List list = xmppCfgDao.getXmppList(entity); + page.setList(list); + return page; + } + public void saveXmppCfg(CfgIndexInfo entity){ + //设置区域运营商信息 + 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()); + xmppCfgDao.saveCfgIndex(entity); + if(entity.getIpPortList()!=null){ + for(IpPortCfg cfg:entity.getIpPortList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + xmppCfgDao.saveIpPortCfg(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(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + + }else{ + xmppCfgDao.updateCfgIndex(entity); + //无效子配置后,再新增子配置 + xmppCfgDao.deleteXmppIpCfg(entity); + AreaIpCfg area = new AreaIpCfg(); + area.setCompileId(entity.getCompileId()); + area.setFunctionId(entity.getFunctionId()); + areaIpCfgDao.deleteAreaIpCfg(area); + entity.setCreateTime(new Date()); + entity.setCreatorId(entity.getCurrentUser().getId()); + if(entity.getIpPortList()!=null){ + for(IpPortCfg cfg:entity.getIpPortList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + xmppCfgDao.saveIpPortCfg(cfg); + } + } + //保存区域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 updateHttpCfgValid(Integer isValid,String ids,Integer functionId){ + CfgIndexInfo entity = new CfgIndexInfo(); + 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(CfgIndexInfo.getTablename()); + entity.setFunctionId(functionId); + xmppCfgDao.updateCfgValid(entity); + //查询子配置 + entity = this.getXmppCfg(Long.parseLong(id)); + if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){ + IpPortCfg cfg = new IpPortCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(IpPortCfg.getTablename()); + xmppCfgDao.updateCfgValid(cfg); + } +// if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){ +// HttpUrlCfg cfg = new HttpUrlCfg(); +// BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); +// cfg.setTableName(HttpUrlCfg.getTablename()); +// xmppCfgDao.updateCfgValid(cfg); +// } + //保存区域IP信息 + if(entity.getAreaCfg()!=null && entity.getAreaCfg().size()>0){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + xmppCfgDao.updateCfgValid(cfg); + } + + } + + } + public void auditXmppCfg(CfgIndexInfo entity,Integer isAudit) throws MaatConvertException{ + //修改数据库审核状态信息 + entity.setTableName(CfgIndexInfo.getTablename()); + xmppCfgDao.auditCfg(entity); + + 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 = this.getXmppCfg(entity.getCfgId()); + if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){ + IpPortCfg cfg = new IpPortCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(IpPortCfg.getTablename()); + xmppCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(ipRegionList,entity.getIpPortList(),1,entity,groupRelationList); + groupRelationList=map.get("groupList"); + ipRegionList=map.get("dstList"); + if(map.get("numRegionList")!=null){ + numRegionList.addAll(map.get("numRegionList")); + } + } + } +// if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){ +// HttpUrlCfg cfg = new HttpUrlCfg(); +// BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); +// cfg.setTableName(HttpUrlCfg.getTablename()); +// xmppCfgDao.auditCfg(cfg); +// if(isAudit==1){ +// Map map = cfgConvert(strRegionList,entity.getHttpUrlList(),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()); + xmppCfgDao.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()); + maatCfg.setUserRegion(entity.getCompileId()+""); + 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("xmpp配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + logger.info("xmpp配置下发响应信息:"+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("xmpp配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.put(json,1); + logger.info("xmpp配置取消配置响应信息:"+result.getMsg()); + } + } + +} diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index a6dfbb03b..df9641e0b 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -584,6 +584,8 @@ action_monit=monitor file_digest_control=file digest control bgp_control=bgp control bgp_ip=bgp Ip +xmpp_control=xmpp control +xmpp_ip=xmpp Ip #===============protocol IP Import start================= chooseFile=Choose File download=Download diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index ec58801a0..aa5722ff1 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -410,6 +410,8 @@ action_monit=\u041C\u043E\u043D\u0438\u0442\u043E\u0440\u0438\u043D\u0433 file_digest_control=file digest control bgp_control=bgp control bgp_ip=bgp Ip +xmpp_control=xmpp control +xmpp_ip=xmpp Ip #===============protocol IP Import start================= chooseFile=Choose File download=Download diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index ae7fa052d..75b4cac9e 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -610,7 +610,9 @@ action_whitelist=\u767D\u540D\u5355 action_monit=\u76D1\u6D4B file_digest_control=\u6587\u4EF6\u6458\u8981\u7BA1\u63A7 bgp_control=BGP\u7BA1\u63A7 -bgp_ip=bgp Ip +bgp_ip=bgp Ip +xmpp_control=XMPP\u7BA1\u63A7 +xmpp_ip=xmpp Ip #===============protocol IP Import start================= chooseFile=\u9009\u62E9\u6587\u4EF6 download=\u6A21\u677F\u4E0B\u8F7D diff --git a/src/main/webapp/WEB-INF/views/cfg/other/xmppForm.jsp b/src/main/webapp/WEB-INF/views/cfg/other/xmppForm.jsp new file mode 100644 index 000000000..8d5d0778a --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/other/xmppForm.jsp @@ -0,0 +1,269 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + + + + +
+
+
+
+
+
+ + + + + + + +
+
+
+ +
+ + + + + +
+ + +
+
+
+ +
+ +
+
+
+
+
+ +
+ + + +
+
+
+
+
+ + + + + + +

+ + +

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

+ + +

+ + <%-- --%> + + + + + + +
+ <%@include file="/WEB-INF/views/cfg/complexCfgForm.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/other/xmppList.jsp b/src/main/webapp/WEB-INF/views/cfg/other/xmppList.jsp new file mode 100644 index 000000000..6d1d6db5e --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/other/xmppList.jsp @@ -0,0 +1,438 @@ +<%@ 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});"/> + +
+
+
+ + +
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + ${indexCfg.cfgDesc } + + + + + + + + + + + + + ${indexCfg.requestName } + + + + + + + + + + + + + + + ${fns:abbr(classify,20)} + + + + + + + + + + + + + + + + + ${fns:abbr(attribute,20)} + + + + + + + + + + + + + + + + + + ${fns:abbr(lableInfo,20)} + + + + + + + + + + + + + ${indexCfg.creatorName }${indexCfg.editorName }${indexCfg.auditorName }
+
${page}
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/other/xmppSubList.jsp b/src/main/webapp/WEB-INF/views/cfg/other/xmppSubList.jsp new file mode 100644 index 000000000..36a14c42d --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/other/xmppSubList.jsp @@ -0,0 +1,174 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + + + + + + +
+ + +
+
+ +
+ + + + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+
+
+
+ + + +
+
+
+
+ +
+
+
+
+ + +
+
+
+
+ + +
+
+ +
+
+
+
+ + +
+
+
+
+ + +
+
+
+
+ +
+
+
+
+
+
+
+
+ \ No newline at end of file