fileDigest模块增加区域信息
修改dns域名取值bug
This commit is contained in:
@@ -318,7 +318,7 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
return entity;
|
||||
}
|
||||
|
||||
public void saveOrUpdateFileDigestCfg(FileDigestCfg entity,ToMaatResult result){
|
||||
public void saveOrUpdateFileDigestCfg(FileDigestCfg entity,ToMaatResult result,String areaCfgIds){
|
||||
//设置区域运营商信息
|
||||
setAreaEffectiveIds(entity);
|
||||
|
||||
@@ -346,7 +346,17 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
}
|
||||
mailCfgDao.saveMailFileDigestCfg(entity);
|
||||
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null&&entity.getAreaCfg().size()>0){
|
||||
for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) {
|
||||
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
areaIpCfgDao.saveAreaIpCfg(areaIpCfg);
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
|
||||
entity.setEditorId(entity.getCurrentUser().getId());
|
||||
entity.setEditTime(new Date());
|
||||
if(result!=null && result.getData()!=null){
|
||||
@@ -354,6 +364,41 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
entity.setDigest(result.getData().getDigest());
|
||||
}
|
||||
fileTransferCfgDao.updateFileDigestCfg(entity);
|
||||
|
||||
areaCfgIds=!StringUtil.isEmpty(areaCfgIds)? ","+areaCfgIds:"";
|
||||
if(!StringUtil.isEmpty(entity.getAreaCfg())){
|
||||
for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) {
|
||||
if(!StringUtil.isEmpty(areaIpCfg.getCfgId())){
|
||||
if(areaCfgIds.contains(","+areaIpCfg.getCfgId()+",")){
|
||||
areaCfgIds=areaCfgIds.replace(areaIpCfg.getCfgId()+",", "");
|
||||
}
|
||||
//修改
|
||||
entity.setEditorId(UserUtils.getUser().getId());
|
||||
entity.setEditTime(entity.getEditTime());
|
||||
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType","cfgId"});
|
||||
areaIpCfgDao.updateAreaIpCfg(areaIpCfg);
|
||||
}else{
|
||||
//新增
|
||||
entity.setCreatorId(UserUtils.getUser().getId());
|
||||
entity.setCreateTime(entity.getEditTime());
|
||||
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
|
||||
,"cfgType"
|
||||
});
|
||||
areaIpCfgDao.saveAreaIpCfg(areaIpCfg);
|
||||
}
|
||||
}
|
||||
}
|
||||
//delete 真是删除areaIpCfg信息
|
||||
if(!StringUtil.isEmpty(areaCfgIds.replaceAll(",", ""))){
|
||||
areaCfgIds=areaCfgIds.substring(1,areaCfgIds.length());
|
||||
for (String cfgId : areaCfgIds.split(",")) {
|
||||
CfgIndexInfo cfg=new CfgIndexInfo();
|
||||
AreaIpCfg areaIpCfg=new AreaIpCfg();
|
||||
areaIpCfg.setCfgId(Long.parseLong(cfgId));
|
||||
areaIpCfgDao.deleteAreaIpCfgByCfgId(areaIpCfg);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,6 +412,15 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
entity.setEditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
fileTransferCfgDao.updateFileDigestCfg(entity);
|
||||
|
||||
entity = fileTransferCfgDao.getFileDigest(Long.parseLong(id));
|
||||
|
||||
AreaIpCfg areaIpCfg=new AreaIpCfg();
|
||||
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
|
||||
,"cfgType"
|
||||
,"cfgId"
|
||||
});
|
||||
areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -381,10 +435,19 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
fileTransferCfgDao.updateFileDigestCfg(entity);
|
||||
|
||||
entity = fileTransferCfgDao.getFileDigest(Long.parseLong(id));
|
||||
|
||||
List list=new ArrayList();
|
||||
list.add(entity);
|
||||
|
||||
AreaIpCfg areaIpCfg=new AreaIpCfg();
|
||||
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
|
||||
,"cfgType"
|
||||
,"cfgId"
|
||||
});
|
||||
areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg);
|
||||
|
||||
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
|
||||
|
||||
|
||||
ToMaatBean maatBean = new ToMaatBean();
|
||||
MaatCfg maatCfg = new MaatCfg();
|
||||
List<MaatCfg> configCompileList = new ArrayList();
|
||||
@@ -406,6 +469,16 @@ public class FileTransferCfgService extends CrudService<FileTransferCfgDao,CfgIn
|
||||
if(map.get("numRegionList")!=null){
|
||||
numRegionList.addAll(map.get("numRegionList"));
|
||||
}
|
||||
|
||||
if(areaIpCfgList != null && areaIpCfgList.size() >0){
|
||||
//TODO DELETE后期删除
|
||||
for (AreaIpCfg areaIpCfga : areaIpCfgList) {
|
||||
areaIpCfga.setCfgType("NTC_IP_RANGE");
|
||||
}
|
||||
Map<String,List> areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
|
||||
groupRelationList=areaMap.get("groupList");
|
||||
areaIpRegionList=areaMap.get("dstList");
|
||||
}
|
||||
}
|
||||
|
||||
//构造提交综合服务参数格式,一条配置提交一次综合服务
|
||||
|
||||
Reference in New Issue
Block a user