ASN 版本恢复1月4号之版本

This commit is contained in:
wangxin
2019-01-18 16:21:20 +08:00
parent ed77da00c4
commit de8496e003
32 changed files with 322 additions and 1203 deletions

View File

@@ -132,8 +132,6 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
//保存asn组织信息 字符串域信息
handleAsn(entity.getAsnKeywords(), entity);
ipCfgDao.saveCfgIndex(entity);
if(entity.getIpPortList()!=null){
for(IpPortCfg cfg:entity.getIpPortList()){
@@ -157,15 +155,42 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
//保存asn组织信息 字符串域信息
if(StringUtils.isNotBlank(entity.getUserRegion4())){
List<FunctionRegionDict> functionRegionDicts=DictUtils.getFunctionRegionDictList(entity.getFunctionId());
FunctionRegionDict regionDict=null;
for(FunctionRegionDict dict:functionRegionDicts) {
if("asn".equals(dict.getConfigServiceType())) {
regionDict=dict;
}
}
if(regionDict!=null) {
String org=entity.getUserRegion4();
List<AsnGroupInfo> asnGroupInfos=asnGroupInfoDao.getValidConfigGroupInfoByName(org);
for(AsnGroupInfo info:asnGroupInfos) {
BaseStringCfg<AsnKeywordCfg> asnKeywordCfg=new AsnKeywordCfg();
BeanUtils.copyProperties(entity, asnKeywordCfg,new String[]{"cfgId","cfgDesc","cfgRegionCode","cfgType","userRegion1","userRegion2","userRegion3"});
asnKeywordCfg.setTableName(AsnKeywordCfg.getTablename());
asnKeywordCfg.setCfgKeywords("AS"+info.getAsnId());
asnKeywordCfg.setExprType(0);
asnKeywordCfg.setMatchMethod(3);
asnKeywordCfg.setExType("0");
asnKeywordCfg.setIsHexbin(0);
asnKeywordCfg.setCfgRegionCode(regionDict.getConfigRegionCode());
asnKeywordCfg.setCfgType(regionDict.getConfigRegionValue());
asnKeywordCfg.setCreateTime(entity.getCreateTime());
asnKeywordCfg.setCreatorId(UserUtils.getUser().getId());
asnKeywordCfg.setFunctionId(regionDict.getFunctionId());
asnKeywordCfg.setCompileId(compileId);
stringCfgDao.saveStringCfgBatch(asnKeywordCfg);
}
}
}
}else{
entity.setEditTime(new Date());
entity.setEditorId(entity.getCurrentUser().getId());
//保存asn组织信息 字符串域信息
handleAsn(entity.getAsnKeywords(), entity);
ipCfgDao.updateCfgIndex(entity);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
//无效子配置后,再新增子配置
ipCfgDao.deleteIpCfg(entity);
stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity);
@@ -173,6 +198,8 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
areaIpCfgDao.deleteAreaIpCfg(area);
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"});
@@ -195,9 +222,8 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
handleAsn(entity.getAsnKeywords(), entity);
//保存asn组织信息 字符串域信息
/*if(StringUtils.isNotBlank(entity.getUserRegion4())){
if(StringUtils.isNotBlank(entity.getUserRegion4())){
List<FunctionRegionDict> functionRegionDicts=DictUtils.getFunctionRegionDictList(entity.getFunctionId());
FunctionRegionDict regionDict=null;
for(FunctionRegionDict dict:functionRegionDicts) {
@@ -231,7 +257,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
}
}
}*/
}
}
}
public void updateIpCfgValid(Integer isValid,String ids,Integer functionId){
@@ -545,8 +571,6 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
numRegionList.addAll(map.get("numRegionList"));
}
}
}else{
maatType=1;
}
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg();
@@ -559,8 +583,26 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
strRegionList=map.get("dstList");
}
}
//asn配置下发
auditAsnCfg(groupRelationList,strRegionList,entity,entity.getAsnKeywords());
if(entity.getAsnKeywords()!=null && entity.getAsnKeywords().size()>0){
String regionValue=entity.getAsnKeywords().get(0).getCfgType();
if(regionValue!=null) {
for(FunctionRegionDict region:dictList) {
if(regionValue.equals(region.getConfigRegionValue())) {
maatType=region.getIsMaat();
break;
}
}
}
AsnKeywordCfg cfg = new AsnKeywordCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(AsnKeywordCfg.getTablename());
ipCfgDao.auditCfg(cfg);
if(isAudit==1&&maatType==Constants.MAAT_TYPE){
Map<String,List> map = cfgConvert(strRegionList,entity.getAsnKeywords(),2,entity,groupRelationList);
groupRelationList=map.get("groupList");
strRegionList=map.get("dstList");
}
}
//保存区域IP信息
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
if(!StringUtil.isEmpty(areaIpCfgList)){
@@ -668,7 +710,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
maatCfg.setCompileId(entity.getCompileId());
maatCfg.setServiceId(entity.getServiceId());
maatCfg.setIsValid(0);//无效
configCompileList.add(addKeepGroupList(maatCfg,entity));
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(entity.getAuditTime());
maatBean.setCreatorName(entity.getCurrentUser().getName());
@@ -863,7 +905,7 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
List<NtcSubscribeIdCfg> subscribeIdList = stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
entity.setIpPortList(ipPortList);
entity.setNtcSubscribeIdCfgList(subscribeIdList);
if(StringUtils.isNotBlank(entity.getCommonGroupIds())) {
if(StringUtils.isNotBlank(entity.getUserRegion4())) {
List<AsnKeywordCfg> asnKeywordCfgs=stringCfgDao.findAsnKeywordCfgList(entity);
entity.setAsnKeywords(asnKeywordCfgs);
}