白名单增加各个操作的定时任务处理

各种批量操作增加定时任务的处理
This commit is contained in:
段冬梅
2019-04-19 18:32:46 +08:00
parent 6bd04a92ce
commit 5b63b0237e
5 changed files with 413 additions and 346 deletions

View File

@@ -99,7 +99,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
c.initDefaultValue();
BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction",
"protocol","protocolId","areaEffectiveIds","cfgRegionCode",
"cfgType","ipPattern","srcIpAddress","portPattern","srcPort","destIpAddress","destPort"});
"cfgType","srcIpPattern","destIpPattern","srcIpAddress","srcPortPattern","destPortPattern","srcPort","destIpAddress","destPort"});
c.setTableName(AreaIpCfg.getTablename());
}
this.saveIpBatch(cfg.getAreaCfg());
@@ -194,6 +194,8 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
}
//TODO 处理定时任务【如果有定时任务则新增】
handelScheduleCfg(entity, entity.getIndexTable());
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -273,6 +275,8 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
}
//TODO 处理定时任务【如果有定时任务则删除旧的,新增新的】
handelScheduleCfg(entity, entity.getIndexTable());
if(isValid==1) {
entity.setIsAudit(1);
entity.setIsValid(1);
@@ -320,9 +324,9 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
cfg.setTableName(AreaIpCfg.getTablename());
ipCfgDao.updateCfgValid(cfg);
}
//TODO 处理定时任务【如果有定时任务则删除旧的,新增新的】
handelScheduleCfg(entity, entity.getIndexTable());
}
//TODO 处理定时任务【如果有定时任务则删除】
}
/**
@@ -349,7 +353,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
c.initDefaultValue();
BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction",
"protocol","protocolId","areaEffectiveIds","cfgRegionCode",
"cfgType","ipPattern","srcIpAddress","portPattern","srcPort","destIpAddress","destPort"});
"cfgType","srcIpPattern","destIpPattern","srcIpAddress","srcPortPattern","destPortPattern","srcPort","destIpAddress","destPort"});
c.setTableName(AreaIpCfg.getTablename());
c.setCreatorId(cfg.getCurrentUser().getId());
c.setCreateTime(date);
@@ -371,9 +375,11 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
,"cfgType"
,"cfgId"
,"ipType"
,"ipPattern"
,"srcIpPattern"
,"destIpPattern"
,"srcIpAddress"
,"portPattern"
,"srcPortPattern"
,"destPortPattern"
,"srcPort"
,"destPort"
,"protocol"
@@ -638,7 +644,12 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
areaIpRegionList=map.get("dstList");
}
}
//TODO 处理定时任务【审核通过-》增加一条sche_new审核不通过-》增加一条sche02sche旧的置为无效配置取消-》增加一条03sche旧的置为无效】。
if(isAudit!=1) {
//处理定时任务【如果有定时任务则删除旧的,新增新的】
handelScheduleCfg(entity, entity.getIndexTable());
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
if(maatType==Constants.CALLBACK_TYPE){
@@ -704,7 +715,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
}else {
throw new RuntimeException("<spring:message code=\"request_service_failed\"/>:"+props.getProperty("unknown_cfg_type"));
}
}else if(isAudit==3){
}else if(isAudit==3 && entity.getIsValid()==1){
if(maatType==Constants.CALLBACK_TYPE){
List<InlineIp> ipList=new ArrayList<>();
for(IpPortCfg cfg :entity.getIpPortList()) {