VoIP ip配置修改

This commit is contained in:
leijun
2018-10-11 18:33:23 +08:00
parent aa6c1963e7
commit 97a06a9874
7 changed files with 250 additions and 21 deletions

View File

@@ -117,12 +117,13 @@ public class AvContentCfgService extends BaseService{
public CfgIndexInfo getCfgIndexInfo(CfgIndexInfo entity) {
CfgIndexInfo cfg=avContentCfgDao.getCfgIndexInfo(entity);
List<NtcSubscribeIdCfg> ntcSubscribeList=getSubscribeIdCfgList(cfg);
List<AvVoipIpCfg> voipIps=getVoipIpCfgList(cfg);
//List<AvVoipIpCfg> voipIps=getVoipIpCfgList(cfg);
List<IpPortCfg> ipPortList = avContentCfgDao.getIpPortList(cfg);
List<AvVoipAccountCfg> voipAccounts=getVoipAccountCfgList(cfg);
cfg.setNtcSubscribeIdCfgList(ntcSubscribeList);
cfg.setVoipIps(voipIps);
//cfg.setVoipIps(voipIps);
cfg.setVoipAccounts(voipAccounts);
cfg.setIpPortList(ipPortList);
return cfg;
}
/* public CfgIndexInfo getCfgIndexInfo2(CfgIndexInfo entity) {
@@ -160,11 +161,17 @@ public class AvContentCfgService extends BaseService{
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
avContentCfgDao.insertCfgIndexInfo(entity);
if(entity.getVoipIps()!=null){
/* if(entity.getVoipIps()!=null){
for (AvVoipIpCfg voipIp : entity.getVoipIps()) {
entity.setVoipIp(voipIp);
avContentCfgDao.insertAvVoipIp(entity);
}
}*/
if(entity.getIpPortList()!=null){
for(IpPortCfg cfg:entity.getIpPortList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
avContentCfgDao.saveIpPortCfg(cfg);
}
}
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
@@ -199,7 +206,8 @@ public class AvContentCfgService extends BaseService{
entity.setEditorId(entity.getCurrentUser().getId());
avContentCfgDao.updateCfgIndexInfo(entity);
//无效子配置后,再新增子配置
avContentCfgDao.deleteAvVoipIp(entity);
//avContentCfgDao.deleteAvVoipIp(entity);
avContentCfgDao.deleteIpCfg(entity);
stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity);
avContentCfgDao.deleteAvVoipAccountCfg(entity);
AreaIpCfg area = new AreaIpCfg();
@@ -208,11 +216,17 @@ public class AvContentCfgService extends BaseService{
areaIpCfgDao.deleteAreaIpCfg(area);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
if(entity.getVoipIps()!=null&&entity.getVoipIps().size()>0){
/*if(entity.getVoipIps()!=null&&entity.getVoipIps().size()>0){
for (AvVoipIpCfg voipIp : entity.getVoipIps()) {
entity.setVoipIp(voipIp);
avContentCfgDao.insertAvVoipIp(entity);
}
}*/
if(entity.getIpPortList()!=null){
for(IpPortCfg cfg:entity.getIpPortList()){
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
avContentCfgDao.saveIpPortCfg(cfg);
}
}
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
@@ -340,7 +354,13 @@ public class AvContentCfgService extends BaseService{
entity.setIsValid(isValid);
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(new Date());
avContentCfgDao.updateAvVoipIp(entity);
//avContentCfgDao.updateAvVoipIp(entity);
if(entity.getIpPortList()!=null && entity.getIpPortList().size()>0){
IpPortCfg cfg = new IpPortCfg();
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
cfg.setTableName(IpPortCfg.getTablename());
avContentCfgDao.updateCfgValid(cfg);
}
avContentCfgDao.updateAvVoipKeywordCfgt(entity);
avContentCfgDao.updateAvVoipAccount(entity);
avContentCfgDao.updateCfgIndexInfo(entity);
@@ -386,7 +406,8 @@ public class AvContentCfgService extends BaseService{
CfgIndexInfo entity = new CfgIndexInfo();
List<CfgIndexInfo> list = new ArrayList();
List<AvVoipIpCfg> voipIpList = new ArrayList();
//List<AvVoipIpCfg> voipIpList = new ArrayList();
List<IpPortCfg> ipPortList =new ArrayList();
List <NtcSubscribeIdCfg> ntcList = new ArrayList();
List<AvVoipAccountCfg> accountList = new ArrayList();
List<AreaIpCfg> areaIpCfgList = new ArrayList();
@@ -409,7 +430,8 @@ public class AvContentCfgService extends BaseService{
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType","cfgId"});
areaIpCfgDao.updateAreaIpCfg(areaIpCfg);
voipIpList=avContentCfgDao.findVoipIpCfgList(entity);
//voipIpList=avContentCfgDao.findVoipIpCfgList(entity);
ipPortList = avContentCfgDao.getIpPortList(entity);
accountList=avContentCfgDao.findVoipAccountCfgList(entity);
ntcList=stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
@@ -424,11 +446,21 @@ public class AvContentCfgService extends BaseService{
List<DigestCfg> digestRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList();
if(isAudit==1){
if(!StringUtil.isEmpty(voipIpList)){
/* if(!StringUtil.isEmpty(voipIpList)){
Map<String,List> ipMap = cfgConvert(ipRegionList,voipIpList,1,entity,groupRelationList);
groupRelationList=ipMap.get("groupList");
ipRegionList=ipMap.get("dstList");
}*/
if(!StringUtil.isEmpty(ipPortList)){
Map<String,List> ipMap = cfgConvert(ipRegionList,ipPortList,1,entity,groupRelationList);
groupRelationList=ipMap.get("groupList");
ipRegionList=ipMap.get("dstList");
if(ipMap.get("numRegionList")!=null){
numRegionList.addAll(ipMap.get("numRegionList"));
}
}
if(!StringUtil.isEmpty(ntcList)){