1、voip合并,2、subscribeId新增时提交的问题

This commit is contained in:
zhanghongqing
2018-09-28 20:20:51 +08:00
parent 75060d9a09
commit a38093347f
8 changed files with 777 additions and 652 deletions

View File

@@ -78,13 +78,13 @@ public class AvContentCfgService extends BaseService{
* @param entity
* @return
*/
public Page<CfgIndexInfo> findAccountPage(Page<CfgIndexInfo> page, CfgIndexInfo entity) {
/*public Page<CfgIndexInfo> findAccountPage(Page<CfgIndexInfo> page, CfgIndexInfo entity) {
entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r"));
entity.setPage(page);
List<CfgIndexInfo> list=avContentCfgDao.findAccountList(entity);
page.setList(list);
return page;
}
}*/
/**
* 根据索引表信息获取voipIpCfg信息
* @param entity
@@ -116,20 +116,16 @@ public class AvContentCfgService extends BaseService{
*/
public CfgIndexInfo getCfgIndexInfo(CfgIndexInfo entity) {
CfgIndexInfo cfg=avContentCfgDao.getCfgIndexInfo(entity);
List<NtcSubscribeIdCfg> ntcSubscribeList=getSubscribeIdCfgList(entity);
if(ntcSubscribeList ==null || ntcSubscribeList.size() <=0){
ntcSubscribeList.add(new NtcSubscribeIdCfg());
}
List<AvVoipIpCfg> voipIps=getVoipIpCfgList(entity);
if(voipIps ==null || voipIps.size() <=0){
voipIps.add(new AvVoipIpCfg());
}
List<NtcSubscribeIdCfg> ntcSubscribeList=getSubscribeIdCfgList(cfg);
List<AvVoipIpCfg> voipIps=getVoipIpCfgList(cfg);
List<AvVoipAccountCfg> voipAccounts=getVoipAccountCfgList(cfg);
cfg.setNtcSubscribeIdCfgList(ntcSubscribeList);
cfg.setVoipIps(voipIps);
cfg.setVoipAccounts(voipAccounts);
return cfg;
}
public CfgIndexInfo getCfgIndexInfo2(CfgIndexInfo entity) {
/* public CfgIndexInfo getCfgIndexInfo2(CfgIndexInfo entity) {
CfgIndexInfo cfg=avContentCfgDao.getCfgIndexInfo(entity);
List<AvVoipAccountCfg> voipAccounts=new ArrayList<>();
voipAccounts=getVoipAccountCfgList(entity);
@@ -145,7 +141,7 @@ public class AvContentCfgService extends BaseService{
cfg.setNtcSubscribeIdCfgList(ntcSubscribeList);
return cfg;
}
}*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdateAvVoip(CfgIndexInfo entity){
@@ -178,6 +174,12 @@ public class AvContentCfgService extends BaseService{
}
}
}
if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){
for(AvVoipAccountCfg voipAccount : entity.getVoipAccounts()){
entity.setVoipAccount(voipAccount);
avContentCfgDao.insertAvVoipAccountCfg(entity);
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
@@ -199,6 +201,7 @@ public class AvContentCfgService extends BaseService{
//无效子配置后,再新增子配置
avContentCfgDao.deleteAvVoipIp(entity);
stringCfgDao.deleteSubscribeIdCfgByCfgIndexInfo(entity);
avContentCfgDao.deleteAvVoipAccountCfg(entity);
AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
@@ -219,6 +222,12 @@ public class AvContentCfgService extends BaseService{
}
}
}
if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){
for (AvVoipAccountCfg voipAccount : entity.getVoipAccounts()) {
entity.setVoipAccount(voipAccount);
avContentCfgDao.insertAvVoipAccountCfg(entity);
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
@@ -230,7 +239,7 @@ public class AvContentCfgService extends BaseService{
}
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
/*@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdateAvVoipAccount(CfgIndexInfo entity){
//设置区域运营商信息
setAreaEffectiveIds(entity);
@@ -311,7 +320,7 @@ public class AvContentCfgService extends BaseService{
}
}
}
}
}*/
/**
@@ -333,6 +342,7 @@ public class AvContentCfgService extends BaseService{
entity.setEditTime(new Date());
avContentCfgDao.updateAvVoipIp(entity);
avContentCfgDao.updateAvVoipKeywordCfgt(entity);
avContentCfgDao.updateAvVoipAccount(entity);
avContentCfgDao.updateCfgIndexInfo(entity);
AreaIpCfg areaIpCfg=new AreaIpCfg();
BeanUtils.copyProperties(entity, areaIpCfg);
@@ -345,7 +355,7 @@ public class AvContentCfgService extends BaseService{
* @param isValid
* @param ids compileIds
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
/* @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void updateAvVoipAccountValid(Integer isAudit,Integer isValid,String compileIds,Integer functionId){
String[] idArray = compileIds.split(",");
for(String id :idArray){
@@ -363,7 +373,7 @@ public class AvContentCfgService extends BaseService{
BeanUtils.copyProperties(entity, areaIpCfg);
areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg);
}
}
}*/
/**
*
* @param isAudit
@@ -372,16 +382,17 @@ public class AvContentCfgService extends BaseService{
* @param functionId
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void auditAvVoip(Integer isAudit,Integer isValid,Integer functionId,String compileId,Date auditTime){
public void auditAvVoip(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime){
CfgIndexInfo entity = new CfgIndexInfo();
List<CfgIndexInfo> list = new ArrayList();
List<AvVoipIpCfg> voipIpList = new ArrayList();
List <NtcSubscribeIdCfg> ntcList = new ArrayList();
List<AvVoipAccountCfg> accountList = new ArrayList();
List<AreaIpCfg> areaIpCfgList = new ArrayList();
CfgIndexInfo searchCfg=new CfgIndexInfo();
searchCfg.setCompileId(Integer.parseInt(compileId));
searchCfg.setCfgId(Long.parseLong(id));
entity = avContentCfgDao.getCfgIndexInfo(searchCfg);
entity.setIsAudit(isAudit);
@@ -390,6 +401,7 @@ public class AvContentCfgService extends BaseService{
entity.setAuditTime(auditTime);
avContentCfgDao.updateAvVoipIp(entity);
avContentCfgDao.updateAvVoipAccount(entity);
avContentCfgDao.updateAvVoipKeywordCfgt(entity);
avContentCfgDao.updateCfgIndexInfo(entity);
@@ -398,6 +410,7 @@ public class AvContentCfgService extends BaseService{
areaIpCfgDao.updateAreaIpCfg(areaIpCfg);
voipIpList=avContentCfgDao.findVoipIpCfgList(entity);
accountList=avContentCfgDao.findVoipAccountCfgList(entity);
ntcList=stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
@@ -423,6 +436,11 @@ public class AvContentCfgService extends BaseService{
groupRelationList=ntcMap.get("groupList");
strRegionList=ntcMap.get("dstList");
}
if(!StringUtil.isEmpty(accountList)){
Map<String,List> accountMap = cfgConvert(strRegionList,accountList,2,entity,groupRelationList);
groupRelationList=accountMap.get("groupList");
strRegionList=accountMap.get("dstList");
}
if(!StringUtil.isEmpty(areaIpCfgList)){
Map<String,List> areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
groupRelationList=areaMap.get("groupList");
@@ -452,10 +470,10 @@ public class AvContentCfgService extends BaseService{
maatBean.setOpAction(Constants.INSERT_ACTION);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("voip IP配置下发配置参数:"+json);
logger.info("voip 配置下发配置参数:"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
logger.info("voip IP配置下发响应信息:"+result.getMsg());
logger.info("voip 配置下发响应信息:"+result.getMsg());
}else if(isAudit==3){
maatCfg.setCompileId(entity.getCompileId());
@@ -469,15 +487,15 @@ public class AvContentCfgService extends BaseService{
maatBean.setOpAction(Constants.UPDATE_ACTION);
//调用服务接口取消配置
String json=gsonToJson(maatBean);
logger.info("voip IP配置下发配置参数:"+json);
logger.info("voip 配置下发配置参数:"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.put(json,1);
logger.info("voip IP配置取消配置响应信息:"+result.getMsg());
logger.info("voip 配置取消配置响应信息:"+result.getMsg());
}
}
/********************************voip业务*********************************/
/********************************voip account业务*********************************/
/**
*
* @param isAudit
@@ -485,7 +503,7 @@ public class AvContentCfgService extends BaseService{
* @param ids 编译Id
* @param functionId
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
/* @Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void auditAvVoipAccount(Integer isAudit,Integer isValid,Integer functionId,String compileId,Date auditTime){
CfgIndexInfo entity = new CfgIndexInfo();
@@ -591,7 +609,7 @@ public class AvContentCfgService extends BaseService{
}
}
}*/
/********************************voip业务*********************************/