diff --git a/src/main/java/com/nis/web/service/configuration/AppCfgService.java b/src/main/java/com/nis/web/service/configuration/AppCfgService.java index 1374c0700..a65c1556b 100644 --- a/src/main/java/com/nis/web/service/configuration/AppCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AppCfgService.java @@ -305,6 +305,9 @@ public class AppCfgService extends BaseService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + // 处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -372,6 +375,10 @@ public class AppCfgService extends BaseService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + + // 处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -1061,6 +1068,12 @@ public class AppCfgService extends BaseService { areaIpRegionList = map.get("dstList"); } } + + if (isAudit != 1) { + // 处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + } + // 构造提交综合服务参数格式,一条配置提交一次综合服务 if (isAudit == 1) { maatCfg.initDefaultValue(); @@ -1852,6 +1865,9 @@ public class AppCfgService extends BaseService { cfg.setTableName(AreaIpCfg.getTablename()); appCfgDao.updateCfgValid(cfg); } + + // 处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); } diff --git a/src/main/java/com/nis/web/service/configuration/AvCfgService.java b/src/main/java/com/nis/web/service/configuration/AvCfgService.java index b158b9ec2..2b761dc9f 100644 --- a/src/main/java/com/nis/web/service/configuration/AvCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AvCfgService.java @@ -124,6 +124,9 @@ public class AvCfgService extends BaseService{ }else{ throw new MaatConvertException(""); } + + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); if(isAudit==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -145,6 +148,9 @@ public class AvCfgService extends BaseService{ } avCfgDao.updateAvFileSample(entity); + + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); if(isAudit==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -358,6 +364,8 @@ public class AvCfgService extends BaseService{ entity.setEditorId(UserUtils.getUser().getId()); entity.setEditTime(new Date()); avCfgDao.updateAvFileSampleValid(entity); + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); } @@ -368,6 +376,10 @@ public class AvCfgService extends BaseService{ //修改数据库审核状态信息 avCfgDao.auditAvFileSample(entity); List list = new ArrayList(); + if(isAudit!=1){ + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + } //一条配置提交一次综合服务 if(isAudit==1){ list.add(entity); 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 27fd16fcd..5389584f1 100644 --- a/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java @@ -194,121 +194,117 @@ public class AvContentCfgService extends BaseService{ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public void saveOrUpdateAvVoip(CfgIndexInfo entity){ //设置区域运营商信息 - setAreaEffectiveIds(entity); - int isValid=0; - if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { - isValid=1; + setAreaEffectiveIds(entity); + int isValid=0; + if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) { + isValid=1; + } + entity.setIsValid(0);//无效 + entity.setIsAudit(0);//未审核 + 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.setIsValid(0);//无效 - entity.setIsAudit(0);//未审核 - 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()); - avContentCfgDao.insertCfgIndexInfo(entity); -/* if(entity.getVoipIps()!=null){ - for (AvVoipIpCfg voipIp : entity.getVoipIps()) { - entity.setVoipIp(voipIp); - avContentCfgDao.insertAvVoipIp(entity); - } - }*/ - if(entity.getIpPortList()!=null){ - for(IpPortCfg cfg:entity.getIpPortList()){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - avContentCfgDao.saveIpPortCfg(cfg); - } - } - if(entity.getNtcSubscribeIdCfgList()!=null){ - for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - avContentCfgDao.insertAvVoipKeywordCfg(cfg); - } - } - if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){ - for(AvVoipAccountCfg cfg:entity.getVoipAccounts()){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - avContentCfgDao.insertAvVoipAccountCfg(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()); - } - if(isValid==1) { - entity.setIsAudit(1); - entity.setIsValid(1); - auditAvVoip(entity,entity.getIsAudit(), Constants.INSERT_ACTION); - } - - - }else{ - entity.setEditTime(new Date()); - entity.setEditorId(entity.getCurrentUser().getId()); - avContentCfgDao.updateCfgIndexInfo(entity); - //无效子配置后,再新增子配置 - //avContentCfgDao.deleteAvVoipIp(entity); - avContentCfgDao.deleteIpCfg(entity); - stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity); - avContentCfgDao.deleteAvVoipAccountCfg(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.getVoipIps()!=null&&entity.getVoipIps().size()>0){ - for (AvVoipIpCfg voipIp : entity.getVoipIps()) { - entity.setVoipIp(voipIp); - avContentCfgDao.insertAvVoipIp(entity); - } - }*/ - if(entity.getIpPortList()!=null){ - for(IpPortCfg cfg:entity.getIpPortList()){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - avContentCfgDao.saveIpPortCfg(cfg); - } - } - if(entity.getNtcSubscribeIdCfgList()!=null){ - for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - avContentCfgDao.insertAvVoipKeywordCfg(cfg); - } - } - if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){ - for(AvVoipAccountCfg cfg:entity.getVoipAccounts()){ - BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); - avContentCfgDao.insertAvVoipAccountCfg(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); - } - } - if(isValid==1) { - entity.setIsAudit(1); - entity.setIsValid(1); - auditAvVoip(entity,entity.getIsAudit(), Constants.UPDATE_ACTION); + entity.setCompileId(compileId); + 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"}); + avContentCfgDao.saveIpPortCfg(cfg); } } + if(entity.getNtcSubscribeIdCfgList()!=null){ + for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + avContentCfgDao.insertAvVoipKeywordCfg(cfg); + } + } + if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){ + for(AvVoipAccountCfg cfg:entity.getVoipAccounts()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + avContentCfgDao.insertAvVoipAccountCfg(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()); + } + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + auditAvVoip(entity,entity.getIsAudit(), Constants.INSERT_ACTION); + } + + }else{ + entity.setEditTime(new Date()); + entity.setEditorId(entity.getCurrentUser().getId()); + avContentCfgDao.updateCfgIndexInfo(entity); + //无效子配置后,再新增子配置 + //avContentCfgDao.deleteAvVoipIp(entity); + avContentCfgDao.deleteIpCfg(entity); + stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity); + avContentCfgDao.deleteAvVoipAccountCfg(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.getVoipIps()!=null&&entity.getVoipIps().size()>0){ + for (AvVoipIpCfg voipIp : entity.getVoipIps()) { + entity.setVoipIp(voipIp); + avContentCfgDao.insertAvVoipIp(entity); + } + }*/ + if(entity.getIpPortList()!=null){ + for(IpPortCfg cfg:entity.getIpPortList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + avContentCfgDao.saveIpPortCfg(cfg); + } + } + if(entity.getNtcSubscribeIdCfgList()!=null){ + for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + avContentCfgDao.insertAvVoipKeywordCfg(cfg); + } + } + if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){ + for(AvVoipAccountCfg cfg:entity.getVoipAccounts()){ + BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"}); + avContentCfgDao.insertAvVoipAccountCfg(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); + } + } + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + if(isValid==1) { + entity.setIsAudit(1); + entity.setIsValid(1); + auditAvVoip(entity,entity.getIsAudit(), Constants.UPDATE_ACTION); + } + } } /*@Transactional(readOnly=false,rollbackFor=RuntimeException.class) @@ -427,6 +423,9 @@ public class AvContentCfgService extends BaseService{ AreaIpCfg areaIpCfg=new AreaIpCfg(); BeanUtils.copyProperties(entity, areaIpCfg); areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg); + + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); } } /** @@ -520,21 +519,23 @@ public class AvContentCfgService extends BaseService{ } } } - //保存区域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()); - avContentCfgDao.updateCfgValid(cfg); - if(isAudit==1){ - Map map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList); - groupRelationList=map.get("groupList"); - areaIpRegionList=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()); + avContentCfgDao.updateCfgValid(cfg); + if(isAudit==1){ + Map map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList); + groupRelationList=map.get("groupList"); + areaIpRegionList=map.get("dstList"); + } + } + if(isAudit!=1){ + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + } //构造提交综合服务参数格式,一条配置提交一次综合服务 if(isAudit==1){ maatCfg.initDefaultValue(); @@ -1475,6 +1476,8 @@ public class AvContentCfgService extends BaseService{ logger.info("获取编译ID出错"); throw new MaatConvertException(":"+e.getMessage()); } + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -1521,6 +1524,8 @@ public class AvContentCfgService extends BaseService{ areaIpCfgDao.saveAreaIpCfg(cfg); } } + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -1566,6 +1571,9 @@ public class AvContentCfgService extends BaseService{ AreaIpCfg areaIpCfg=new AreaIpCfg(); BeanUtils.copyProperties(entity, areaIpCfg); areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg); + + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); } } /** @@ -1648,7 +1656,10 @@ public class AvContentCfgService extends BaseService{ areaIpRegionList=map.get("dstList"); } } - + if(isAudit!=1){ + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + } //构造提交综合服务参数格式,一条配置提交一次综合服务 if(isAudit==1){ maatCfg.initDefaultValue(); diff --git a/src/main/java/com/nis/web/service/configuration/BgpCfgService.java b/src/main/java/com/nis/web/service/configuration/BgpCfgService.java index 16950f1f7..bcef41656 100644 --- a/src/main/java/com/nis/web/service/configuration/BgpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/BgpCfgService.java @@ -170,6 +170,9 @@ public class BgpCfgService extends CrudService { throw new MaatConvertException(""); } + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -237,6 +240,9 @@ public class BgpCfgService extends CrudService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -297,7 +303,8 @@ public class BgpCfgService extends CrudService { cfg.setTableName(AreaIpCfg.getTablename()); bgpCfgDao.updateCfgValid(cfg); } - + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); } } @@ -391,6 +398,10 @@ public class BgpCfgService extends CrudService { areaIpRegionList=map.get("dstList"); } } + if(isAudit!=1){ + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + } //构造提交综合服务参数格式,一条配置提交一次综合服务 if(isAudit==1){ diff --git a/src/main/java/com/nis/web/service/configuration/DdosCfgService.java b/src/main/java/com/nis/web/service/configuration/DdosCfgService.java index 6c6000e8e..6696b778f 100644 --- a/src/main/java/com/nis/web/service/configuration/DdosCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/DdosCfgService.java @@ -93,12 +93,12 @@ public class DdosCfgService extends BaseService{ if(ppsThreadshold==null) { entity.setPpsThreadshold(0l); } + entity.setIsValid(0); + entity.setIsAudit(0); //新增 if(entity.getCfgId()==null){ entity.setCreatorId(UserUtils.getUser().getId()); entity.setCreateTime(createTime); - entity.setIsValid(0); - entity.setIsAudit(0); if(entity.getCompileId()==null||entity.getCompileId().intValue()==0) { //调用服务接口获取compileId List compileIds = new ArrayList(); @@ -120,6 +120,8 @@ public class DdosCfgService extends BaseService{ }else { throw new RuntimeException("Could not get compileId!"); } + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -128,12 +130,12 @@ public class DdosCfgService extends BaseService{ //修改 }else{ Date editTime=new Date(); - entity.setIsValid(0); - entity.setIsAudit(0); entity.setEditorId(UserUtils.getUser().getId()); entity.setEditTime(editTime); ddosCfgDao.update(entity); + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -160,6 +162,8 @@ public class DdosCfgService extends BaseService{ entity.setEditorId(UserUtils.getUser().getId()); entity.setEditTime(new Date()); ddosCfgDao.update(entity); + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); } } /** @@ -288,7 +292,10 @@ public class DdosCfgService extends BaseService{ entity=this.getDdosIpCfg(entity.getCfgId(),entity.getCompileId()); - + if(isAudit!=1){ + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + } if(entity.getIsAudit()==1){ List ipList=new ArrayList(); ipList.add(entity); diff --git a/src/main/java/com/nis/web/service/configuration/DomainService.java b/src/main/java/com/nis/web/service/configuration/DomainService.java index 0c5b93421..09ae49f8a 100644 --- a/src/main/java/com/nis/web/service/configuration/DomainService.java +++ b/src/main/java/com/nis/web/service/configuration/DomainService.java @@ -483,6 +483,10 @@ public class DomainService extends CrudService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -526,7 +530,9 @@ public class DomainService extends CrudService { areaIpCfgDao.saveAreaIpCfg(cfg); } } - if(isValid==1) { + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); auditDomainCfg(entity, entity.getIsAudit(),Constants.UPDATE_ACTION); @@ -568,113 +574,117 @@ public class DomainService extends CrudService { cfg.setTableName(AreaIpCfg.getTablename()); websiteCfgDao.updateCfgValid(cfg); } - + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); } } public void auditDomainCfg(CfgIndexInfo entity,Integer isAudit,Integer opAction) throws MaatConvertException{ - // TODO Auto-generated method stub //修改数据库审核状态信息 - entity.setTableName(CfgIndexInfo.getTablename()); - entity.setIsAudit(isAudit); - entity.setAuditorId(UserUtils.getUser().getId()); - entity.setAuditTime(new Date()); - websiteCfgDao.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.getDomainCfg(entity.getCfgId(),entity.getCompileId()); - - if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){ - HttpUrlCfg cfg = new HttpUrlCfg(); - BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); - cfg.setTableName(HttpUrlCfg.getTablename()); - websiteCfgDao.auditCfg(cfg); - if(isAudit==1){ - Map map = cfgConvert(strRegionList,entity.getHttpUrlList(),2,entity,groupRelationList); - groupRelationList=map.get("groupList"); - 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)){ - AreaIpCfg cfg = new AreaIpCfg(); - BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); - cfg.setTableName(AreaIpCfg.getTablename()); - websiteCfgDao.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()); - - configCompileList.add(maatCfg); - maatBean.setConfigCompileList(configCompileList); - maatBean.setAuditTime(entity.getAuditTime()); - maatBean.setCreatorName(entity.getCurrentUser().getName()); - maatBean.setVersion(Constants.MAAT_VERSION); - maatBean.setOpAction(opAction); - //调用服务接口下发配置数据 - String json=gsonToJson(maatBean); - logger.info("domain配置下发配置参数:"+json); - //调用服务接口下发配置 - ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); - logger.info("domain配置下发响应信息:"+result.getMsg()); + entity.setTableName(CfgIndexInfo.getTablename()); + entity.setIsAudit(isAudit); + entity.setAuditorId(UserUtils.getUser().getId()); + entity.setAuditTime(new Date()); + websiteCfgDao.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.getDomainCfg(entity.getCfgId(),entity.getCompileId()); + + if(entity.getHttpUrlList()!=null && entity.getHttpUrlList().size()>0){ + HttpUrlCfg cfg = new HttpUrlCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(HttpUrlCfg.getTablename()); + websiteCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(strRegionList,entity.getHttpUrlList(),2,entity,groupRelationList); + groupRelationList=map.get("groupList"); + 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)){ + AreaIpCfg cfg = new AreaIpCfg(); + BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"}); + cfg.setTableName(AreaIpCfg.getTablename()); + websiteCfgDao.auditCfg(cfg); + if(isAudit==1){ + Map map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList); + groupRelationList=map.get("groupList"); + areaIpRegionList=map.get("dstList"); + } + } + if(isAudit!=1){ + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + } + + //构造提交综合服务参数格式,一条配置提交一次综合服务 + 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()); + + configCompileList.add(maatCfg); + maatBean.setConfigCompileList(configCompileList); + maatBean.setAuditTime(entity.getAuditTime()); + maatBean.setCreatorName(entity.getCurrentUser().getName()); + maatBean.setVersion(Constants.MAAT_VERSION); + maatBean.setOpAction(opAction); + //调用服务接口下发配置数据 + String json=gsonToJson(maatBean); + logger.info("domain配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.postMaatCfg(json); + logger.info("domain配置下发响应信息:"+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("domain配置下发配置参数:"+json); - //调用服务接口下发配置 - ToMaatResult result = ConfigServiceUtil.put(json,1); - logger.info("domain配置取消配置响应信息:"+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("domain配置下发配置参数:"+json); + //调用服务接口下发配置 + ToMaatResult result = ConfigServiceUtil.put(json,1); + logger.info("domain配置取消配置响应信息:"+result.getMsg()); + } } public Page getDomainList(Page page, CfgIndexInfo entity){ // 生成数据权限过滤条件(dsf为dataScopeFilter的简写,在xml中使用 ${sqlMap.dsf}调用权限SQL) diff --git a/src/main/java/com/nis/web/service/configuration/FileTransferCfgService.java b/src/main/java/com/nis/web/service/configuration/FileTransferCfgService.java index 540623532..5167bf9e2 100644 --- a/src/main/java/com/nis/web/service/configuration/FileTransferCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/FileTransferCfgService.java @@ -172,6 +172,8 @@ public class FileTransferCfgService extends CrudService:"+e.getMessage()); } + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -228,6 +230,8 @@ public class FileTransferCfgService extends CrudService numRegionList = new ArrayList(); List digestRegionList = new ArrayList(); List areaIpRegionList = new ArrayList(); + if(isAudit!=1){ + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + } if(isAudit==1){ Map map = cfgConvert(digestRegionList,list,5,entity,groupRelationList); @@ -775,6 +794,8 @@ public class FileTransferCfgService extends CrudService:"+e.getMessage()); } + + // 处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -284,6 +288,9 @@ public class HttpRedirectCfgService extends CrudService areaIpCfgDao.saveAreaIpCfg(cfg); } } + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); if(isValid==1) { entity.setIsAudit(1); @@ -275,6 +277,8 @@ public class InterceptCfgService extends CrudService areaIpCfgDao.saveAreaIpCfg(cfg); } } + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); if(isValid==1) { entity.setIsAudit(1); @@ -343,7 +347,8 @@ public class InterceptCfgService extends CrudService cfg.setTableName(AreaIpCfg.getTablename()); websiteCfgDao.updateCfgValid(cfg); } - + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); } } @@ -484,6 +489,10 @@ public class InterceptCfgService extends CrudService } } + if (isAudit != 1) { + // 处理定时任务【如果有定时任务则删除旧的,新增新的】 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + } //构造提交综合服务参数格式,一条配置提交一次综合服务 if(isAudit==1){ maatCfg.initDefaultValue(); diff --git a/src/main/java/com/nis/web/service/configuration/IpCfgService.java b/src/main/java/com/nis/web/service/configuration/IpCfgService.java index b81517b5d..225ed3139 100644 --- a/src/main/java/com/nis/web/service/configuration/IpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/IpCfgService.java @@ -197,7 +197,7 @@ public class IpCfgService extends CrudService { } } - // TODO 处理定时任务【如果有定时任务则新增】 + //处理定时任务 handelScheduleCfg(entity, entity.getIndexTable(), entity); if (isValid == 1) { @@ -280,7 +280,7 @@ public class IpCfgService extends CrudService { } } - // TODO 处理定时任务【如果有定时任务则删除旧的,新增新的】 + //处理定时任务 handelScheduleCfg(entity, entity.getIndexTable(), entity); if (isValid == 1) { @@ -329,7 +329,7 @@ public class IpCfgService extends CrudService { cfg.setTableName(AreaIpCfg.getTablename()); ipCfgDao.updateCfgValid(cfg); } - // TODO 处理定时任务【如果有定时任务则删除旧的,新增新的】 + //处理定时任务 handelScheduleCfg(entity, entity.getIndexTable(), entity); } @@ -663,7 +663,7 @@ public class IpCfgService extends CrudService { } if (isAudit != 1) { - // 处理定时任务【如果有定时任务则删除旧的,新增新的】 + // 处理定时任务 handelScheduleCfg(entity, entity.getIndexTable(), entity); } 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 43a85a5f5..e2521f654 100644 --- a/src/main/java/com/nis/web/service/configuration/MailCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/MailCfgService.java @@ -177,6 +177,9 @@ public class MailCfgService extends CrudService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -241,6 +244,8 @@ public class MailCfgService extends CrudService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -288,7 +293,8 @@ public class MailCfgService extends CrudService { cfg.setTableName(AreaIpCfg.getTablename()); mailCfgDao.updateCfgValid(cfg); } - + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); } } @@ -373,7 +379,10 @@ public class MailCfgService extends CrudService { areaIpRegionList=map.get("dstList"); } } - + if(isAudit!=1){ + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + } //构造提交综合服务参数格式,一条配置提交一次综合服务 if(isAudit==1){ maatCfg.initDefaultValue(); 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 d4b8c3c93..5ad0f70b2 100644 --- a/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/WebsiteCfgService.java @@ -288,6 +288,8 @@ public class WebsiteCfgService extends CrudService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -367,7 +369,8 @@ public class WebsiteCfgService extends CrudService { areaIpCfgDao.saveAreaIpCfg(cfg); } } - + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -432,7 +435,8 @@ public class WebsiteCfgService extends CrudService { cfg.setTableName(AreaIpCfg.getTablename()); websiteCfgDao.updateCfgValid(cfg); } - + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); } } @@ -546,7 +550,10 @@ public class WebsiteCfgService extends CrudService { areaIpRegionList=map.get("dstList"); } } - + if(isAudit!=1){ + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + } //构造提交综合服务参数格式,一条配置提交一次综合服务 if(isAudit==1){ maatCfg.initDefaultValue(); @@ -764,6 +771,8 @@ public class WebsiteCfgService extends CrudService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -814,7 +823,8 @@ public class WebsiteCfgService extends CrudService { areaIpCfgDao.saveAreaIpCfg(cfg); } } - + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -862,7 +872,8 @@ public class WebsiteCfgService extends CrudService { cfg.setTableName(AreaIpCfg.getTablename()); websiteCfgDao.updateCfgValid(cfg); } - + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); } } @@ -935,7 +946,10 @@ public class WebsiteCfgService extends CrudService { areaIpRegionList=map.get("dstList"); } } - + if(isAudit!=1){ + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + } //构造提交综合服务参数格式,一条配置提交一次综合服务 if(isAudit==1){ maatCfg.initDefaultValue(); @@ -1057,6 +1071,8 @@ public class WebsiteCfgService extends CrudService { areaIpCfgDao.saveAreaIpCfg(cfg); } } + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -1110,7 +1126,8 @@ public class WebsiteCfgService extends CrudService { areaIpCfgDao.saveAreaIpCfg(cfg); } } - + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); if(isValid==1) { entity.setIsAudit(1); entity.setIsValid(1); @@ -1164,7 +1181,8 @@ public class WebsiteCfgService extends CrudService { cfg.setTableName(AreaIpCfg.getTablename()); websiteCfgDao.updateCfgValid(cfg); } - + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); } } @@ -1243,6 +1261,10 @@ public class WebsiteCfgService extends CrudService { areaIpRegionList=map.get("dstList"); } } + if(isAudit!=1){ + //处理定时任务 + handelScheduleCfg(entity, entity.getIndexTable(), entity); + } //构造提交综合服务参数格式,一条配置提交一次综合服务 if(isAudit==1){ diff --git a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp index 7c96657be..315539c59 100644 --- a/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/basicprotocol/list.jsp @@ -463,7 +463,7 @@ - + diff --git a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp index 6d29e96fb..e96d0fc64 100644 --- a/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/ddosIpCfgForm.jsp @@ -76,7 +76,9 @@ $(function(){ } loading('onloading...'); //将disable属性的元素删除 - $("#cron.disabled").remove(); + $("#cron").find(".disabled").each(function(){ + $(this).remove(); + }); form.submit(); }, errorContainer: "#messageBox",