Merge branch 'develop' of https://git.mesalab.cn/K18_NTCS_WEB/NTC.git
into develop Conflicts: src/main/java/com/nis/web/service/BaseService.java asn group中修改组织变更和asn no变更,不重新获取groupId逻辑 ip addr 的asn 修改为手动输入,后台check app ip和asn ip配置取消,取消分组中最后一条配置时,失效整个compile,并且修改groupId的状态为为无效。 无效的asn group删除时,删除其下的所有asn ip
This commit is contained in:
@@ -1168,7 +1168,9 @@ public class AppCfgService extends BaseService {
|
||||
List<NumBoundaryCfg> numRegionList = new ArrayList();
|
||||
List<DigestCfg> digestRegionList = new ArrayList();
|
||||
List<IpCfg> areaIpRegionList = new ArrayList();
|
||||
Integer serviceId=0;
|
||||
this.auditAppIpCfg(entitys);
|
||||
serviceId=entitys.get(0).getServiceId();
|
||||
// for(AppIpCfg entity:entitys) {
|
||||
// // 保存区域IP信息
|
||||
// List<AreaIpCfg> areaIpCfgList = areaIpCfgDao.getByCompileId(entitys.get(0).getCompileId());
|
||||
@@ -1272,26 +1274,54 @@ public class AppCfgService extends BaseService {
|
||||
throw new RuntimeException("Unknown configGroupInfo isIssued value");
|
||||
}
|
||||
} else if (isAudit == 3) {
|
||||
//已经下发过的,调用分组复用配置删除接口
|
||||
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(entitys,Constants.VALID_NO,groupId));
|
||||
groupReuseCfg.setIpRegionList(ipRegionList);
|
||||
groupReuseCfg.setStrRegionList(strRegionList);
|
||||
groupReuseCfg.setNumRegionList(numRegionList);
|
||||
groupReuseList.add(groupReuseCfg);
|
||||
maatBean.setGroupReuseCfgList(groupReuseList);
|
||||
maatBean.setAuditTime(entitys.get(0).getAuditTime());
|
||||
maatBean.setCreatorName(entitys.get(0).getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("app协议IP域删除配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.auditCommonGroupRegionSources(json,3);
|
||||
logger.info("app协议IP域删除配置响应信息:"+result.getMsg());
|
||||
//判断配置取消之后,是否还有有效的配置
|
||||
if(hasValidAppIp(configGroupInfo.getCompileId())){
|
||||
//已经下发过的,调用分组复用配置删除接口
|
||||
GroupReuseAddBean maatBean = new GroupReuseAddBean();
|
||||
List<GroupReuseCfg> groupReuseList=new ArrayList<>();
|
||||
GroupReuseCfg groupReuseCfg=new GroupReuseCfg();
|
||||
ipRegionList.addAll(groupReuseCfgAddRemoveConvert(entitys,Constants.VALID_NO,groupId));
|
||||
groupReuseCfg.setIpRegionList(ipRegionList);
|
||||
groupReuseCfg.setStrRegionList(strRegionList);
|
||||
groupReuseCfg.setNumRegionList(numRegionList);
|
||||
groupReuseList.add(groupReuseCfg);
|
||||
maatBean.setGroupReuseCfgList(groupReuseList);
|
||||
maatBean.setAuditTime(entitys.get(0).getAuditTime());
|
||||
maatBean.setCreatorName(entitys.get(0).getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口下发配置数据
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("app协议IP域删除配置下发配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.auditCommonGroupRegionSources(json,3);
|
||||
logger.info("app协议IP域删除配置响应信息:"+result.getMsg());
|
||||
}else{
|
||||
//修改组的有效状态为无效。并发送compileid 配置取消 此后组的app ip不再自动下发。
|
||||
ConfigGroupInfo appConfigGroup=new ConfigGroupInfo();
|
||||
appConfigGroup.setIsIssued(0);
|
||||
appConfigGroup.setUpdateTime(new Date());
|
||||
appConfigGroup.setGroupId(configGroupInfo.getGroupId());
|
||||
configGroupInfoDao.updateConfigGroupInfobyGroupId(appConfigGroup);
|
||||
//asn group下没有asn ip之后,需要失效整个compileId,并且不保留公共组信息
|
||||
ToMaatBean maatBean = new ToMaatBean();
|
||||
maatCfg.setCompileId(configGroupInfo.getCompileId());
|
||||
maatCfg.setServiceId(serviceId);
|
||||
maatCfg.setIsValid(0);//无效
|
||||
//configCompileList.add(addKeepGroupList(maatCfg,entity));
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(new Date());
|
||||
maatBean.setCreatorName(UserUtils.getUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
//调用服务接口取消配置
|
||||
String json=gsonToJson(maatBean);
|
||||
logger.info("app Ip 取消配置参数:"+json);
|
||||
//调用服务接口下发配置
|
||||
ToMaatResult result = ConfigServiceUtil.put(json,1);
|
||||
logger.info("app Ip 取消配置响应信息:"+result.getMsg());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2116,4 +2146,13 @@ public class AppCfgService extends BaseService {
|
||||
|
||||
}
|
||||
|
||||
public boolean hasValidAppIp(Integer compileId){
|
||||
List<AppIpCfg> appIps=appCfgDao.findAppIpByCompileId(compileId);
|
||||
if(!StringUtil.isEmpty(appIps)){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -863,19 +863,15 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
|
||||
List<NtcSubscribeIdCfg> subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
|
||||
entity.setIpPortList(ipPortList);
|
||||
entity.setNtcSubscribeIdCfgList(subscribeIdList);
|
||||
if(StringUtils.isNotBlank(entity.getCommonGroupIds())) {
|
||||
List<AsnKeywordCfg> asnKeywordCfgs=stringCfgDao.findAsnKeywordCfgList(entity);
|
||||
entity.setAsnKeywords(asnKeywordCfgs);
|
||||
}
|
||||
List<AsnKeywordCfg> asnKeywordCfgs=stringCfgDao.findAsnKeywordCfgList(entity);
|
||||
entity.setAsnKeywords(asnKeywordCfgs);
|
||||
return entity;
|
||||
}
|
||||
public CfgIndexInfo exportIpInfo(CfgIndexInfo entity){
|
||||
List<IpPortCfg> ipPortList = ipCfgDao.getIpPortList(entity);
|
||||
entity.setIpPortList(ipPortList);
|
||||
if(StringUtils.isNotBlank(entity.getUserRegion4())) {
|
||||
List<AsnKeywordCfg> asnKeywordCfgs=stringCfgDao.findAsnKeywordCfgList(entity);
|
||||
entity.setAsnKeywords(asnKeywordCfgs);
|
||||
}
|
||||
List<AsnKeywordCfg> asnKeywordCfgs=stringCfgDao.findAsnKeywordCfgList(entity);
|
||||
entity.setAsnKeywords(asnKeywordCfgs);
|
||||
return entity;
|
||||
}
|
||||
public BaseIpCfg getIpCfgById(String tableName,long id){
|
||||
|
||||
Reference in New Issue
Block a user