Stream media配置保存并下发功能增加;
This commit is contained in:
@@ -222,16 +222,14 @@ public class AvContentCfgService extends BaseService{
|
||||
}
|
||||
if(entity.getNtcSubscribeIdCfgList()!=null){
|
||||
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
entity.setNtcSubscribeIdCfg(cfg);
|
||||
avContentCfgDao.insertAvVoipKeywordCfg(entity);
|
||||
}
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
avContentCfgDao.insertAvVoipKeywordCfg(cfg);
|
||||
}
|
||||
}
|
||||
if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){
|
||||
for(AvVoipAccountCfg voipAccount : entity.getVoipAccounts()){
|
||||
entity.setVoipAccount(voipAccount);
|
||||
avContentCfgDao.insertAvVoipAccountCfg(entity);
|
||||
for(AvVoipAccountCfg cfg:entity.getVoipAccounts()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
avContentCfgDao.insertAvVoipAccountCfg(cfg);
|
||||
}
|
||||
}
|
||||
//保存区域IP信息
|
||||
@@ -277,16 +275,14 @@ public class AvContentCfgService extends BaseService{
|
||||
}
|
||||
if(entity.getNtcSubscribeIdCfgList()!=null){
|
||||
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
entity.setNtcSubscribeIdCfg(cfg);
|
||||
avContentCfgDao.insertAvVoipKeywordCfg(entity);
|
||||
}
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
avContentCfgDao.insertAvVoipKeywordCfg(cfg);
|
||||
}
|
||||
}
|
||||
if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){
|
||||
for (AvVoipAccountCfg voipAccount : entity.getVoipAccounts()) {
|
||||
entity.setVoipAccount(voipAccount);
|
||||
avContentCfgDao.insertAvVoipAccountCfg(entity);
|
||||
for(AvVoipAccountCfg cfg:entity.getVoipAccounts()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
avContentCfgDao.insertAvVoipAccountCfg(cfg);
|
||||
}
|
||||
}
|
||||
//保存区域IP信息
|
||||
@@ -1419,6 +1415,12 @@ public class AvContentCfgService extends BaseService{
|
||||
public void saveOrUpdateContUrl(CfgIndexInfo entity){
|
||||
//设置区域运营商信息
|
||||
setAreaEffectiveIds(entity);
|
||||
|
||||
int isValid=0;
|
||||
if(!StringUtil.isEmpty(entity.getIsValid()) && entity.getIsValid()==1) {
|
||||
isValid=1;
|
||||
}
|
||||
|
||||
entity.setIsValid(0);//无效
|
||||
entity.setIsAudit(0);//未审核
|
||||
if(entity.getCfgId()==null){
|
||||
@@ -1432,24 +1434,22 @@ public class AvContentCfgService extends BaseService{
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||
avContentCfgDao.insertCfgIndexInfo(entity);
|
||||
if(entity.getIpPortList()!=null){
|
||||
if(!StringUtil.isEmpty(entity.getIpPortList())){
|
||||
for(IpPortCfg cfg:entity.getIpPortList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
avContentCfgDao.saveIpPortCfg(cfg);
|
||||
}
|
||||
}
|
||||
if(entity.getNtcSubscribeIdCfgList()!=null){
|
||||
if(!StringUtil.isEmpty(entity.getNtcSubscribeIdCfgList())){
|
||||
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
entity.setNtcSubscribeIdCfg(cfg);
|
||||
avContentCfgDao.insertAvVoipKeywordCfg(entity);
|
||||
}
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
avContentCfgDao.insertAvVoipKeywordCfg(cfg);
|
||||
}
|
||||
}
|
||||
if(entity.getAvContUrlCfgList()!=null&&entity.getAvContUrlCfgList().size()>0){
|
||||
for(AvContUrlCfg avContUrlCfg : entity.getAvContUrlCfgList()){
|
||||
entity.setAvContUrlCfg(avContUrlCfg);
|
||||
avContentCfgDao.saveAvContUrlCfg(entity);
|
||||
if(!StringUtil.isEmpty(entity.getAvContUrlCfgList())){
|
||||
for(AvContUrlCfg cfg:entity.getAvContUrlCfgList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
avContentCfgDao.saveAvContUrlCfg(cfg);
|
||||
}
|
||||
}
|
||||
//保存区域IP信息
|
||||
@@ -1465,6 +1465,11 @@ public class AvContentCfgService extends BaseService{
|
||||
logger.info("获取编译ID出错");
|
||||
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
|
||||
}
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditContUrl(entity,entity.getIsAudit(), Constants.INSERT_ACTION);
|
||||
}
|
||||
|
||||
}else{
|
||||
entity.setEditTime(new Date());
|
||||
@@ -1480,34 +1485,37 @@ public class AvContentCfgService extends BaseService{
|
||||
areaIpCfgDao.deleteAreaIpCfg(area);
|
||||
entity.setCreateTime(new Date());
|
||||
entity.setCreatorId(entity.getCurrentUser().getId());
|
||||
if(entity.getIpPortList()!=null){
|
||||
if(!StringUtil.isEmpty(entity.getIpPortList())){
|
||||
for(IpPortCfg cfg:entity.getIpPortList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
avContentCfgDao.saveIpPortCfg(cfg);
|
||||
}
|
||||
}
|
||||
if(entity.getNtcSubscribeIdCfgList()!=null){
|
||||
if(!StringUtil.isEmpty(entity.getNtcSubscribeIdCfgList())){
|
||||
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
|
||||
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
|
||||
entity.setNtcSubscribeIdCfg(cfg);
|
||||
avContentCfgDao.insertAvVoipKeywordCfg(entity);
|
||||
}
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
avContentCfgDao.insertAvVoipKeywordCfg(cfg);
|
||||
}
|
||||
}
|
||||
if(entity.getAvContUrlCfgList()!=null&&entity.getAvContUrlCfgList().size()>0){
|
||||
for(AvContUrlCfg avContUrlCfg : entity.getAvContUrlCfgList()){
|
||||
entity.setAvContUrlCfg(avContUrlCfg);
|
||||
avContentCfgDao.saveAvContUrlCfg(entity);
|
||||
if(!StringUtil.isEmpty(entity.getAvContUrlCfgList())){
|
||||
for(AvContUrlCfg cfg:entity.getAvContUrlCfgList()){
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
avContentCfgDao.saveAvContUrlCfg(cfg);
|
||||
}
|
||||
}
|
||||
//保存区域IP信息
|
||||
if(entity.getAreaCfg()!=null){
|
||||
for(AreaIpCfg cfg:entity.getAreaCfg()){
|
||||
cfg.initDefaultValue();
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
|
||||
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
|
||||
areaIpCfgDao.saveAreaIpCfg(cfg);
|
||||
}
|
||||
}
|
||||
if(isValid==1) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
auditContUrl(entity,entity.getIsAudit(), Constants.INSERT_ACTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1558,32 +1566,16 @@ public class AvContentCfgService extends BaseService{
|
||||
* @param functionId
|
||||
*/
|
||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||
public void auditContUrl(Integer isAudit,Integer isValid,Integer functionId,String id,Date auditTime){
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
List<CfgIndexInfo> list = new ArrayList();
|
||||
List<IpPortCfg> ipPortList =new ArrayList();
|
||||
List <NtcSubscribeIdCfg> ntcList = new ArrayList();
|
||||
List<AreaIpCfg> areaIpCfgList = new ArrayList();
|
||||
List<AvContUrlCfg> avContUrlCfgList = new ArrayList();
|
||||
CfgIndexInfo searchCfg=new CfgIndexInfo();
|
||||
searchCfg.setCfgId(Long.parseLong(id));
|
||||
|
||||
entity = avContentCfgDao.getCfgIndexInfo(searchCfg);
|
||||
public void auditContUrl(CfgIndexInfo entity,Integer isAudit,Integer opAction){
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(auditTime);
|
||||
avContentCfgDao.updateAvVoipIp(entity);
|
||||
avContentCfgDao.updateAvVoipKeywordCfgt(entity);
|
||||
avContentCfgDao.updateCfgIndexInfo(entity);
|
||||
entity.setTableName(CfgIndexInfo.getTablename());
|
||||
entity.setAuditTime(new Date());
|
||||
avContentCfgDao.updateCfgValid(entity);
|
||||
AreaIpCfg areaIpCfg=new AreaIpCfg();
|
||||
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType","cfgId"});
|
||||
areaIpCfgDao.updateAreaIpCfg(areaIpCfg);
|
||||
|
||||
ipPortList = avContentCfgDao.getIpPortList(entity);
|
||||
ntcList=stringCfgDao.findSubscribeIdCfgListByCfgIndexInfo(entity);
|
||||
areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
|
||||
avContUrlCfgList=avContentCfgDao.getAvContUrlList(entity);
|
||||
ToMaatBean maatBean = new ToMaatBean();
|
||||
MaatCfg maatCfg = new MaatCfg();
|
||||
List<MaatCfg> configCompileList = new ArrayList();
|
||||
@@ -1594,44 +1586,56 @@ public class AvContentCfgService extends BaseService{
|
||||
List<DigestCfg> digestRegionList = new ArrayList();
|
||||
List<IpCfg> areaIpRegionList = new ArrayList();
|
||||
|
||||
if(avContUrlCfgList!=null && avContUrlCfgList.size()>0){
|
||||
entity.setAvContUrlCfgList(avContUrlCfgList);
|
||||
if(entity.getNtcSubscribeIdCfgList()!=null && entity.getNtcSubscribeIdCfgList().size()>0){
|
||||
NtcSubscribeIdCfg cfg = new NtcSubscribeIdCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
cfg.setTableName(NtcSubscribeIdCfg.getTablename());
|
||||
avContentCfgDao.updateCfgValid(cfg);
|
||||
if(isAudit==1){
|
||||
Map<String,List> ntcMap = cfgConvert(strRegionList,entity.getNtcSubscribeIdCfgList(),2,entity,groupRelationList);
|
||||
groupRelationList=ntcMap.get("groupList");
|
||||
strRegionList=ntcMap.get("dstList");
|
||||
}
|
||||
}
|
||||
if(entity.getAvContUrlCfgList()!=null && entity.getAvContUrlCfgList().size()>0){
|
||||
AvContUrlCfg cfg = new AvContUrlCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
cfg.setTableName(AvContUrlCfg.getTablename());
|
||||
avContentCfgDao.updateCfgValid(cfg);
|
||||
if(isAudit==1){
|
||||
Map<String,List> urlMap = cfgConvert(strRegionList,entity.getAvContUrlCfgList(),2,entity,groupRelationList);
|
||||
groupRelationList=urlMap.get("groupList");
|
||||
strRegionList=urlMap.get("dstList");
|
||||
}
|
||||
}
|
||||
|
||||
if(isAudit==1){
|
||||
if(!StringUtil.isEmpty(ipPortList)){
|
||||
IpPortCfg cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[] { "cfgId" });
|
||||
cfg.setTableName(IpPortCfg.getTablename());
|
||||
avContentCfgDao.updateCfgValid(cfg);
|
||||
Map<String,List> ipMap = cfgConvert(ipRegionList,ipPortList,1,entity,groupRelationList);
|
||||
if(!StringUtil.isEmpty(entity.getIpPortList())){
|
||||
IpPortCfg cfg = new IpPortCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[] { "cfgId" });
|
||||
cfg.setTableName(IpPortCfg.getTablename());
|
||||
avContentCfgDao.updateCfgValid(cfg);
|
||||
if(isAudit==1){
|
||||
Map<String,List> ipMap = cfgConvert(ipRegionList,entity.getIpPortList(),1,entity,groupRelationList);
|
||||
groupRelationList=ipMap.get("groupList");
|
||||
ipRegionList=ipMap.get("dstList");
|
||||
if(ipMap.get("numRegionList")!=null){
|
||||
numRegionList.addAll(ipMap.get("numRegionList"));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
if(!StringUtil.isEmpty(avContUrlCfgList)){
|
||||
Map<String,List> urlMap = cfgConvert(strRegionList,avContUrlCfgList,2,entity,groupRelationList);
|
||||
groupRelationList=urlMap.get("groupList");
|
||||
strRegionList=urlMap.get("dstList");
|
||||
}
|
||||
|
||||
if(!StringUtil.isEmpty(ntcList)){
|
||||
Map<String,List> ntcMap = cfgConvert(strRegionList,ntcList,2,entity,groupRelationList);
|
||||
groupRelationList=ntcMap.get("groupList");
|
||||
strRegionList=ntcMap.get("dstList");
|
||||
}
|
||||
|
||||
if(!StringUtil.isEmpty(areaIpCfgList)){
|
||||
Map<String,List> areaMap = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
|
||||
groupRelationList=areaMap.get("groupList");
|
||||
areaIpRegionList=areaMap.get("dstList");
|
||||
}
|
||||
|
||||
//保存区域IP信息
|
||||
List<AreaIpCfg> areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
|
||||
if(!StringUtil.isEmpty(areaIpCfgList)){
|
||||
AreaIpCfg cfg = new AreaIpCfg();
|
||||
BeanUtils.copyProperties(entity, cfg, new String[]{"cfgId"});
|
||||
cfg.setTableName(AreaIpCfg.getTablename());
|
||||
avContentCfgDao.updateCfgValid(cfg);
|
||||
if(isAudit==1){
|
||||
Map<String,List> map = cfgConvert(areaIpRegionList,areaIpCfgList,1,entity,groupRelationList);
|
||||
groupRelationList=map.get("groupList");
|
||||
areaIpRegionList=map.get("dstList");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1640,7 +1644,7 @@ public class AvContentCfgService extends BaseService{
|
||||
maatCfg.initDefaultValue();
|
||||
BeanUtils.copyProperties(entity, maatCfg);
|
||||
maatCfg.setAction(entity.getAction());
|
||||
maatCfg.setAuditTime(auditTime);
|
||||
maatCfg.setAuditTime(entity.getAuditTime());
|
||||
maatCfg.setIpRegionList(ipRegionList);
|
||||
maatCfg.setStrRegionList(strRegionList);
|
||||
maatCfg.setNumRegionList(numRegionList);
|
||||
@@ -1651,7 +1655,7 @@ public class AvContentCfgService extends BaseService{
|
||||
maatCfg.setIsValid(entity.getIsValid());
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(auditTime);
|
||||
maatBean.setAuditTime(entity.getAuditTime());
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.INSERT_ACTION);
|
||||
@@ -1668,7 +1672,7 @@ public class AvContentCfgService extends BaseService{
|
||||
maatCfg.setIsValid(0);//无效
|
||||
configCompileList.add(maatCfg);
|
||||
maatBean.setConfigCompileList(configCompileList);
|
||||
maatBean.setAuditTime(auditTime);
|
||||
maatBean.setAuditTime(entity.getAuditTime());
|
||||
maatBean.setCreatorName(entity.getCurrentUser().getName());
|
||||
maatBean.setVersion(Constants.MAAT_VERSION);
|
||||
maatBean.setOpAction(Constants.UPDATE_ACTION);
|
||||
|
||||
Reference in New Issue
Block a user