summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangxin <[email protected]>2019-07-26 10:39:59 +0800
committerwangxin <[email protected]>2019-07-26 10:39:59 +0800
commit94cf096be46019e1dfd847c280b59744004da3bd (patch)
treea02d5b686147c3d318a7dd4a220902cb33a29602
parente37128e2c89149b4d0c960aab806c447b8db2f31 (diff)
域清空的时候,当任务是有效的时候删除定时任务,当任务是未生效状态时候也要删除定时任务
-rw-r--r--src/main/java/com/nis/web/service/BaseService.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/main/java/com/nis/web/service/BaseService.java b/src/main/java/com/nis/web/service/BaseService.java
index e985c5b9c..9bb6340f1 100644
--- a/src/main/java/com/nis/web/service/BaseService.java
+++ b/src/main/java/com/nis/web/service/BaseService.java
@@ -3318,7 +3318,7 @@ public abstract class BaseService {
ScriberIdCommGroupDao scriberIdCommGroupDao=SpringContextHolder.getBean(ScriberIdCommGroupDao.class);
DomainCommGroupDao domainCommGroupDao=SpringContextHolder.getBean(DomainCommGroupDao.class);
CommonPolicyDao commonPolicyDao=SpringContextHolder.getBean(CommonPolicyDao.class);
- SchedulerDao schedulerDao=SpringContextHolder.getBean(SchedulerDao.class);
+ //SchedulerDao schedulerDao=SpringContextHolder.getBean(SchedulerDao.class);
AreaIpCfgDao areaIpCfgDao=SpringContextHolder.getBean(AreaIpCfgDao.class);
Set<String> ipDeletedGroups=new HashSet<>();
Set<String> urlDeletedGroups=new HashSet<>();
@@ -3356,6 +3356,7 @@ public abstract class BaseService {
realGroupIds.deleteCharAt(realGroupIds.toString().length()-1);
}
List<CfgIndexInfo> toUpdateCfgIndexInfos=new ArrayList<>();
+ List<CfgIndexInfo> toDelSchedualCfgIndexInfos=new ArrayList<>();
List<CfgIndexInfo> toCancelCfgIndexInfos=new ArrayList<>();
//没有
if(StringUtils.isBlank(realGroupIds.toString())){
@@ -3399,6 +3400,7 @@ public abstract class BaseService {
cfgIndexInfo.setCommonGroupIds("");
if(cfgIndexInfo.getIsValid()==Constants.VALID_NO){//未生效,直接更新配置,不用下发
toUpdateCfgIndexInfos.add(cfgIndexInfo);
+ toDelSchedualCfgIndexInfos.add(cfgIndexInfo);
}else{//生效,需要取消配置
cfgIndexInfo.setIsValid(Constants.VALID_NO);
cfgIndexInfo.setIsAudit(Constants.AUDIT_NOT_YES);
@@ -3597,22 +3599,22 @@ public abstract class BaseService {
//查询定时任务,失效定时任务
if(ids.toString().length()>0){
ids.deleteCharAt(ids.toString().length()-1);
- schedulerDao.inValidByCompileIds(ids.toString());
+ commonPolicyDao.cancelScheduCfg(ids.toString(),CfgIndexInfo.getTablename());
}
}
- if(toUpdateCfgIndexInfos.size()>0){
+ if(toDelSchedualCfgIndexInfos.size()>0){
StringBuffer ids=new StringBuffer();
- for(CfgIndexInfo info:toUpdateCfgIndexInfos){
+ for(CfgIndexInfo info:toDelSchedualCfgIndexInfos){
commonPolicyDao.updateCfgIndexCommonGroupIds(info);
if(StringUtils.isBlank(info.getCommonGroupIds())){
ids.append(info.getCompileId()+",");
}
}
//查询定时任务,失效定时任务
-// if(ids.toString().length()>0){
-// ids.deleteCharAt(ids.toString().length()-1);
-// commonPolicyDao.cancelScheduCfg(ids.toString(),CfgIndexInfo.getTablename());
-// }
+ if(ids.toString().length()>0){
+ ids.deleteCharAt(ids.toString().length()-1);
+ commonPolicyDao.cancelScheduCfg(ids.toString(),CfgIndexInfo.getTablename());
+ }
}
//向maat发送配置
if(CollectionUtils.isNotEmpty(cancelMaatBean.getConfigCompileList())){