Stream media配置保存并下发功能增加;

This commit is contained in:
duandongmei
2019-04-15 22:38:22 +08:00
parent 910072f66f
commit e4effb7ab4
5 changed files with 155 additions and 122 deletions

View File

@@ -41,6 +41,7 @@ import com.nis.util.DateUtils;
import com.nis.util.StringUtil; import com.nis.util.StringUtil;
import com.nis.util.excel.ExportExcel; import com.nis.util.excel.ExportExcel;
import com.nis.web.controller.BaseController; import com.nis.web.controller.BaseController;
import com.nis.web.security.UserUtils;
/** /**
* 处理音视频文本业务 * 处理音视频文本业务
@@ -665,7 +666,15 @@ public class AvContentController extends BaseController {
Date auditTime = new Date(); Date auditTime = new Date();
for (String id : idArray) { for (String id : idArray) {
try { try {
avContentCfgService.auditContUrl(isAudit, isValid, functionId, id, auditTime); CfgIndexInfo entity=new CfgIndexInfo();
entity.setCfgId(Long.parseLong(id));
entity = avContentCfgService.getCfgIndexInfo(entity);
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(new Date());
entity.setFunctionId(functionId);
avContentCfgService.auditContUrl(entity,isAudit,Constants.INSERT_ACTION);
addMessage(redirectAttributes, "success", "audit_success"); addMessage(redirectAttributes, "success", "audit_success");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();

View File

@@ -11,6 +11,7 @@ import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.BaseStringCfg;
import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.IpPortCfg; import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.web.dao.MyBatisDao; import com.nis.web.dao.MyBatisDao;
@@ -28,15 +29,15 @@ public interface AvContentCfgDao {
public void deleteIpCfg(CfgIndexInfo entity); public void deleteIpCfg(CfgIndexInfo entity);
public List<AvContUrlCfg> getAvContUrlList(CfgIndexInfo entity); public List<AvContUrlCfg> getAvContUrlList(CfgIndexInfo entity);
public void saveAvContUrlCfg(CfgIndexInfo entity); public void saveAvContUrlCfg(AvContUrlCfg entity);
public void saveAvContUrlCfgNew(AvContUrlCfg entity); public void saveAvContUrlCfgNew(AvContUrlCfg entity);
public void deleteAvContUrlCfg(CfgIndexInfo entity); public void deleteAvContUrlCfg(CfgIndexInfo entity);
public void insertCfgIndexInfo(CfgIndexInfo entity); public void insertCfgIndexInfo(CfgIndexInfo entity);
public void insertAvVoipIp(CfgIndexInfo entity); public void insertAvVoipIp(CfgIndexInfo entity);
public void insertAvVoipAccountCfg(CfgIndexInfo entity); public void insertAvVoipAccountCfg(AvVoipAccountCfg entity);
public void saveAvVoipAccountCfg(AvVoipAccountCfg entity); public void saveAvVoipAccountCfg(AvVoipAccountCfg entity);
public void insertAvVoipKeywordCfg(CfgIndexInfo entity); public void insertAvVoipKeywordCfg(NtcSubscribeIdCfg entity);
public void updateCfgIndexInfo(CfgIndexInfo entity); public void updateCfgIndexInfo(CfgIndexInfo entity);
public void updateAvVoipIp(CfgIndexInfo entity); public void updateAvVoipIp(CfgIndexInfo entity);

View File

@@ -671,12 +671,12 @@
#{lable,jdbcType=VARCHAR}, #{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR}, #{areaEffectiveIds,jdbcType=VARCHAR},
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{avContUrlCfg.cfgKeywords,jdbcType=VARCHAR}, #{cfgKeywords,jdbcType=VARCHAR},
#{avContUrlCfg.cfgType,jdbcType=VARCHAR}, #{cfgType,jdbcType=VARCHAR},
#{avContUrlCfg.cfgRegionCode,jdbcType=INTEGER}, #{cfgRegionCode,jdbcType=INTEGER},
#{avContUrlCfg.exprType,jdbcType=INTEGER}, #{exprType,jdbcType=INTEGER},
#{avContUrlCfg.matchMethod,jdbcType=INTEGER}, #{matchMethod,jdbcType=INTEGER},
#{avContUrlCfg.isHexbin,jdbcType=INTEGER}, #{isHexbin,jdbcType=INTEGER},
#{doLog,jdbcType=INTEGER} #{doLog,jdbcType=INTEGER}
) )
</insert> </insert>
@@ -743,6 +743,9 @@
<!-- insert cfgIndexInfox --> <!-- insert cfgIndexInfox -->
<insert id="insertCfgIndexInfo" parameterType="com.nis.domain.configuration.CfgIndexInfo" > <insert id="insertCfgIndexInfo" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
<selectKey resultType="java.lang.Long" order="AFTER" keyProperty="cfgId">
SELECT LAST_INSERT_ID()
</selectKey>
insert into cfg_index_info( insert into cfg_index_info(
CFG_DESC, CFG_DESC,
ACTION, ACTION,
@@ -843,18 +846,18 @@
#{lable,jdbcType=VARCHAR}, #{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR}, #{areaEffectiveIds,jdbcType=VARCHAR},
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{voipIp.ipType,jdbcType=INTEGER}, #{ipType,jdbcType=INTEGER},
#{voipIp.srcIpAddress,jdbcType=VARCHAR}, #{srcIpAddress,jdbcType=VARCHAR},
#{voipIp.ipPattern,jdbcType=INTEGER}, #{ipPattern,jdbcType=INTEGER},
#{voipIp.portPattern,jdbcType=INTEGER}, #{portPattern,jdbcType=INTEGER},
#{voipIp.srcPort,jdbcType=VARCHAR}, #{srcPort,jdbcType=VARCHAR},
#{voipIp.protocol,jdbcType=INTEGER}, #{protocol,jdbcType=INTEGER},
#{voipIp.protocolId,jdbcType=INTEGER}, #{protocolId,jdbcType=INTEGER},
#{voipIp.direction,jdbcType=INTEGER}, #{direction,jdbcType=INTEGER},
#{voipIp.destPort,jdbcType=VARCHAR}, #{destPort,jdbcType=VARCHAR},
#{voipIp.destIpAddress,jdbcType=VARCHAR}, #{destIpAddress,jdbcType=VARCHAR},
#{voipIp.cfgType,jdbcType=VARCHAR}, #{cfgType,jdbcType=VARCHAR},
#{voipIp.cfgRegionCode,jdbcType=INTEGER} #{cfgRegionCode,jdbcType=INTEGER}
) )
</insert> </insert>
<!-- insert AV_VOIP_ACCOUNT_CFG表信息 --> <!-- insert AV_VOIP_ACCOUNT_CFG表信息 -->
@@ -905,12 +908,12 @@
#{lable,jdbcType=VARCHAR}, #{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR}, #{areaEffectiveIds,jdbcType=VARCHAR},
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{voipAccount.cfgKeywords,jdbcType=VARCHAR}, #{cfgKeywords,jdbcType=VARCHAR},
#{voipAccount.cfgType,jdbcType=VARCHAR}, #{cfgType,jdbcType=VARCHAR},
#{voipAccount.cfgRegionCode,jdbcType=INTEGER}, #{cfgRegionCode,jdbcType=INTEGER},
#{voipAccount.exprType,jdbcType=INTEGER}, #{exprType,jdbcType=INTEGER},
#{voipAccount.matchMethod,jdbcType=INTEGER}, #{matchMethod,jdbcType=INTEGER},
#{voipAccount.isHexbin,jdbcType=INTEGER} #{isHexbin,jdbcType=INTEGER}
) )
</insert> </insert>
<insert id="saveAvVoipAccountCfg" parameterType="com.nis.domain.configuration.AvVoipAccountCfg" > <insert id="saveAvVoipAccountCfg" parameterType="com.nis.domain.configuration.AvVoipAccountCfg" >
@@ -1016,12 +1019,12 @@
#{lable,jdbcType=VARCHAR}, #{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR}, #{areaEffectiveIds,jdbcType=VARCHAR},
#{functionId,jdbcType=INTEGER}, #{functionId,jdbcType=INTEGER},
#{ntcSubscribeIdCfg.cfgKeywords,jdbcType=VARCHAR}, #{cfgKeywords,jdbcType=VARCHAR},
#{ntcSubscribeIdCfg.cfgType,jdbcType=VARCHAR}, #{cfgType,jdbcType=VARCHAR},
#{ntcSubscribeIdCfg.cfgRegionCode,jdbcType=INTEGER}, #{cfgRegionCode,jdbcType=INTEGER},
#{ntcSubscribeIdCfg.exprType,jdbcType=INTEGER}, #{exprType,jdbcType=INTEGER},
#{ntcSubscribeIdCfg.matchMethod,jdbcType=INTEGER}, #{matchMethod,jdbcType=INTEGER},
#{ntcSubscribeIdCfg.isHexbin,jdbcType=INTEGER} #{isHexbin,jdbcType=INTEGER}
) )
</insert> </insert>
@@ -2107,7 +2110,7 @@
</where> </where>
</select> </select>
<update id="updateCfgValid" parameterType="com.nis.domain.configuration.BaseCfg"> <update id="updateCfgValid" parameterType="com.nis.domain.configuration.BaseCfg">
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER}, update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER},is_audit = #{isAudit,jdbcType=INTEGER},
editor_id = #{editorId,jdbcType=INTEGER} , editor_id = #{editorId,jdbcType=INTEGER} ,
edit_time = #{editTime,jdbcType=TIMESTAMP} edit_time = #{editTime,jdbcType=TIMESTAMP}
<trim prefix="WHERE" prefixOverrides="AND |OR "> <trim prefix="WHERE" prefixOverrides="AND |OR ">

View File

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

View File

@@ -172,6 +172,8 @@
<input type="hidden" name="cfgId" value="${_cfg.cfgId}"> <input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}"> <input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}"> <input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" name="isValid" value="${_cfg.isValid}">
<input type="hidden" name="isAudit" value="${_cfg.isAudit}">
<input type="hidden" id="serviceId" name="serviceId" <input type="hidden" id="serviceId" name="serviceId"
value="${_cfg.serviceId}"> value="${_cfg.serviceId}">
@@ -367,9 +369,23 @@
<div class="col-md-6"> <div class="col-md-6">
<div class="row"> <div class="row">
<div class="col-md-offset-3 col-md-8"> <div class="col-md-offset-3 col-md-8">
<button id="save" type="submit" class="btn green"> <c:set var="auditPermission" value="false"></c:set>
<spring:message code="submit" /> <!-- 拥有配置新增直接生效的功能权限 -->
</button> <shiro:hasPermission name="save:audit:permission">
<c:set var="auditPermission" value="true"></c:set>
</shiro:hasPermission>
<c:choose>
<c:when test="${!(fns:getUser().isAdmin()) && auditPermission}">
<button id="audit" type="submit" class="btn green">
<spring:message code="submit" />
</button>
</c:when>
<c:otherwise>
<button id="save" type="submit" class="btn green">
<spring:message code="submit" />
</button>
</c:otherwise>
</c:choose>
<button id="cancel" type="button" class="btn default"> <button id="cancel" type="button" class="btn default">
<spring:message code="cancel" /> <spring:message code="cancel" />
</button> </button>