修复ddos定时任务界面BUG;
修复基础协议定时任务图标不显示bug; 所有业务增加定时任务逻辑
This commit is contained in:
@@ -194,120 +194,124 @@ 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<Integer> 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<Integer> 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);
|
||||
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("<spring:message code=\"request_service_failed\"/>:"+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);
|
||||
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("<spring:message code=\"request_service_failed\"/>:"+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)
|
||||
@@ -426,6 +430,9 @@ public class AvContentCfgService extends BaseService{
|
||||
AreaIpCfg areaIpCfg=new AreaIpCfg();
|
||||
BeanUtils.copyProperties(entity, areaIpCfg);
|
||||
areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg);
|
||||
|
||||
//处理定时任务
|
||||
handelScheduleCfg(entity, entity.getIndexTable(), entity);
|
||||
}
|
||||
}
|
||||
/**
|
||||
@@ -520,19 +527,22 @@ public class AvContentCfgService extends BaseService{
|
||||
}
|
||||
}
|
||||
//保存区域IP信息
|
||||
List<AreaIpCfg> 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<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
|
||||
groupRelationList=map.get("groupList");
|
||||
areaIpRegionList=map.get("dstList");
|
||||
}
|
||||
}
|
||||
|
||||
List<AreaIpCfg> 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<String,List> 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();
|
||||
@@ -1489,6 +1499,8 @@ public class AvContentCfgService extends BaseService{
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
//处理定时任务
|
||||
handelScheduleCfg(entity, entity.getIndexTable(), entity);
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
@@ -1535,6 +1547,8 @@ public class AvContentCfgService extends BaseService{
|
||||
areaIpCfgDao.saveAreaIpCfg(cfg);
|
||||
}
|
||||
}
|
||||
//处理定时任务
|
||||
handelScheduleCfg(entity, entity.getIndexTable(), entity);
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
@@ -1580,6 +1594,9 @@ public class AvContentCfgService extends BaseService{
|
||||
AreaIpCfg areaIpCfg=new AreaIpCfg();
|
||||
BeanUtils.copyProperties(entity, areaIpCfg);
|
||||
areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg);
|
||||
|
||||
//处理定时任务
|
||||
handelScheduleCfg(entity, entity.getIndexTable(), entity);
|
||||
}
|
||||
}
|
||||
/**
|
||||
@@ -1662,7 +1679,10 @@ public class AvContentCfgService extends BaseService{
|
||||
areaIpRegionList=map.get("dstList");
|
||||
}
|
||||
}
|
||||
|
||||
if(isAudit!=1){
|
||||
//处理定时任务
|
||||
handelScheduleCfg(entity, entity.getIndexTable(), entity);
|
||||
}
|
||||
//构造提交综合服务参数格式,一条配置提交一次综合服务
|
||||
if(isAudit==1){
|
||||
maatCfg.initDefaultValue();
|
||||
|
||||
Reference in New Issue
Block a user