voip 拆分为VoIP IP跟VoIP Account

This commit is contained in:
zhanghongqing
2018-08-20 11:35:07 +08:00
parent a8aebd9e23
commit 26d4ed4a9c
10 changed files with 2092 additions and 704 deletions

View File

@@ -8,12 +8,14 @@ package com.nis.domain.configuration;
* @version V1.0
*/
public class AvVoipIpCfg extends BaseIpCfg {
private static final String tableName="av_voip_ip_cfg";
/**
*
*/
private static final long serialVersionUID = -942354218504312548L;
public static String getTablename() {
return tableName;
}
}

File diff suppressed because one or more lines are too long

View File

@@ -9,23 +9,32 @@ import com.nis.domain.configuration.AvVoipIpCfg;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.BaseStringCfg;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.web.dao.MyBatisDao;
@MyBatisDao
public interface AvContentCfgDao {
public List<CfgIndexInfo> findVoipList(CfgIndexInfo entity) ;
public List<CfgIndexInfo> findAccountList(CfgIndexInfo entity) ;
public List<AvVoipIpCfg> findVoipIpCfgList(CfgIndexInfo entity);
public List<AvVoipAccountCfg> findVoipAccountCfgList(CfgIndexInfo entity);
public List<NtcSubscribeIdCfg> findSubscribeIdCfgList(CfgIndexInfo entity);
public CfgIndexInfo getCfgIndexInfo(CfgIndexInfo entity);
public void insertCfgIndexInfo(CfgIndexInfo entity);
public void insertAvVoipIp(CfgIndexInfo entity);
public void insertAvVoipAccount(CfgIndexInfo entity);
public void insertAvVoipAccountCfg(CfgIndexInfo entity);
public void insertAvVoipKeywordCfg(CfgIndexInfo entity);
public void updateCfgIndexInfo(CfgIndexInfo entity);
public void updateAvVoipIp(CfgIndexInfo entity);
public void updateAvVoipAccount(CfgIndexInfo entity);
public void updateAvVoipKeywordCfgt(CfgIndexInfo entity);
public void deleteAvVoipIp(CfgIndexInfo entity);
public void deleteAvVoipAccount(CfgIndexInfo entity);
public void deleteAvVoipKeywordCfg(CfgIndexInfo entity);
public void deleteAvVoipAccountCfg(CfgIndexInfo entity);
public BaseIpCfg findIpCfgById(BaseIpCfg entity) ;
public void insertIp(BaseIpCfg entity);
@@ -38,4 +47,5 @@ public interface AvContentCfgDao {
public void updateString(BaseStringCfg entity);
public List<BaseStringCfg> findStringList(BaseStringCfg entity) ;
public List<BaseStringCfg> getStringList(BaseStringCfg entity) ;
}

View File

@@ -187,7 +187,7 @@
r.audit_time,r.service_id,r.request_id,r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable,
r.expr_type,r.match_method,r.is_hexbin,r.area_effective_ids,r.function_id,r.cfg_region_code
</sql>
<!-- voip条件查询列表信息 -->
<!-- voip IP条件查询列表信息 -->
<select id="findVoipList" resultMap="CfgIndexInfoMap" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
SELECT
<include refid="AvVoip_Column" />
@@ -289,6 +289,121 @@
</where>
)
</if>
<if test="(ntcSubscribeIdCfg.cfgKeywords != null and ntcSubscribeIdCfg.cfgKeywords != '') ">
AND r.compile_id in (select f.compile_id from ntc_subscribe_id_cfg f
<where>
<if test="ntcSubscribeIdCfg.cfgKeywords != null and ntcSubscribeIdCfg.cfgKeywords != ''">
and f.cfg_keywords like concat(concat('%',#{ntcSubscribeIdCfg.cfgKeywords,jdbcType=VARCHAR}),'%')
</if>
<if test="compileId != null">
and f.compile_id =#{compileId,jdbcType=INTEGER}
</if>
</where>
)
</if>
<!-- 数据范围过滤 -->
${sqlMap.dsf}
</trim>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY r.CFG_ID desc
</otherwise>
</choose>
</select>
<!-- voip Account条件查询列表信息 -->
<select id="findAccountList" resultMap="CfgIndexInfoMap" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
SELECT
<include refid="AvVoip_Column" />
<trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName
</trim>
FROM cfg_index_info r
left join sys_user s on r.creator_id=s.id
left join sys_user e on r.editor_id=e.id
left join sys_user u on r.auditor_id=u.id
left join request_info ri on r.request_id=ri.id
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="cfgDesc != null and cfgDesc != ''">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
</if>
<if test="action != null">
AND r.ACTION=#{action,jdbcType=INTEGER}
</if>
<if test="isValid != null">
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
</if>
<if test="isValid == null">
AND r.IS_VALID != -1
</if>
<if test="isAudit != null">
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
</if>
<if test="creatorName != null and creatorName != ''">
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
</if>
<!-- <if test="search_create_time_start != null and search_create_time_start != ''">
<![CDATA[AND r.CREATE_TIME >= #{search_create_time_start,jdbcType=TIMESTAMP}]]>
</if>
<if test="search_create_time_end != null and search_create_time_end != ''">
<![CDATA[AND r.CREATE_TIME <= #{search_create_time_end,jdbcType=TIMESTAMP}]]>
</if> -->
<if test="editorName != null and editorName != ''">
AND r.EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
</if>
<!-- <if test="search_edit_time_start != null and search_edit_time_start != ''">
<![CDATA[AND r.EDIT_TIME >= #{search_edit_time_start,jdbcType=TIMESTAMP}]]>
</if>
<if test="search_edit_time_end != null and search_edit_time_end != ''">
<![CDATA[AND r.EDIT_TIME <= #{search_edit_time_end,jdbcType=TIMESTAMP}]]>
</if> -->
<if test="auditorName != null and auditorName != ''">
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
</if>
<!-- <if test="search_audit_time_start != null and search_audit_time_start != ''">
<![CDATA[AND r.AUDIT_TIME >= #{search_audit_time_start,jdbcType=TIMESTAMP}]]>
</if>
<if test="search_audit_time_end != null and search_audit_time_end != ''">
<![CDATA[AND r.AUDIT_TIME <= #{search_audit_time_end,jdbcType=TIMESTAMP}]]>
</if> -->
<if test="serviceId != null">
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
</if>
<if test="requestId != null">
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
</if>
<if test="compileId != null">
AND r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>
<if test="classify != null and classify != ''">
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
</if>
<if test="attribute != null and attribute != ''">
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
</if>
<if test="lable != null and lable != ''">
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
</if>
<if test="areaEffectiveIds != null and areaEffectiveIds != ''">
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
</if>
<if test="functionId != null">
AND r.function_id=#{functionId,jdbcType=INTEGER}
</if>
<if test="(voipAccount.cfgKeywords != null and voipAccount.cfgKeywords != '') ">
AND r.compile_id in (select f.compile_id from av_voip_account_cfg f
<where>
@@ -301,6 +416,18 @@
</where>
)
</if>
<if test="(ntcSubscribeIdCfg.cfgKeywords != null and ntcSubscribeIdCfg.cfgKeywords != '') ">
AND r.compile_id in (select f.compile_id from ntc_subscribe_id_cfg f
<where>
<if test="ntcSubscribeIdCfg.cfgKeywords != null and ntcSubscribeIdCfg.cfgKeywords != ''">
and f.cfg_keywords like concat(concat('%',#{ntcSubscribeIdCfg.cfgKeywords,jdbcType=VARCHAR}),'%')
</if>
<if test="compileId != null">
and f.compile_id =#{compileId,jdbcType=INTEGER}
</if>
</where>
)
</if>
<!-- 数据范围过滤 -->
${sqlMap.dsf}
@@ -352,6 +479,26 @@
</choose>
</where>
</select>
<!-- 根据compileId获取avVoipAccountCfg信息 -->
<select id="findSubscribeIdCfgList" resultMap="BaseStringCfgMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
select
<include refid="BaseStringCfg_Column" />
from ntc_subscribe_id_cfg r
<where>
<if test="compileId != null">
and r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<choose>
<when test="isValid != null">
and r.is_valid=#{isValid,jdbcType=INTEGER}
</when>
<otherwise>
and r.is_valid != -1
</otherwise>
</choose>
</where>
</select>
<!-- 根据Id获取cfgIndexInfo信息 -->
<select id="getCfgIndexInfo" resultMap="CfgIndexInfoMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
@@ -490,7 +637,7 @@
)
</insert>
<!-- insert AV_VOIP_ACCOUNT_CFG表信息 -->
<insert id="insertAvVoipAccount" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
<insert id="insertAvVoipAccountCfg" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
insert into av_voip_account_cfg (
CFG_DESC,
ACTION,
@@ -545,6 +692,62 @@
#{voipAccount.isHexbin,jdbcType=INTEGER}
)
</insert>
<!-- insert AV_VOIP_ACCOUNT_CFG表信息 -->
<insert id="insertAvVoipKeywordCfg" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
insert into ntc_subscribe_id_cfg (
CFG_DESC,
ACTION,
IS_VALID,
IS_AUDIT,
CREATOR_ID,
CREATE_TIME,
EDITOR_ID,
EDIT_TIME,
AUDITOR_ID,
AUDIT_TIME,
SERVICE_ID,
REQUEST_ID,
COMPILE_ID,
IS_AREA_EFFECTIVE,
CLASSIFY,
ATTRIBUTE,
LABLE,
AREA_EFFECTIVE_IDS,
function_id,
cfg_keywords,
cfg_type,
cfg_region_code,
expr_type,
match_method,
is_hexbin
)values (
#{cfgDesc,jdbcType=VARCHAR},
#{action,jdbcType=INTEGER},
0,
0,
#{creatorId,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP},
#{editorId,jdbcType=INTEGER},
#{editTime,jdbcType=TIMESTAMP},
#{auditorId,jdbcType=INTEGER},
#{auditTime,jdbcType=TIMESTAMP},
#{serviceId,jdbcType=INTEGER},
#{requestId,jdbcType=INTEGER},
#{compileId,jdbcType=INTEGER},
#{isAreaEffective,jdbcType=INTEGER},
#{classify,jdbcType=VARCHAR},
#{attribute,jdbcType=VARCHAR},
#{lable,jdbcType=VARCHAR},
#{areaEffectiveIds,jdbcType=VARCHAR},
#{functionId,jdbcType=INTEGER},
#{ntcSubscribeIdCfg.cfgKeywords,jdbcType=VARCHAR},
#{ntcSubscribeIdCfg.cfgType,jdbcType=VARCHAR},
#{ntcSubscribeIdCfg.cfgRegionCode,jdbcType=INTEGER},
#{ntcSubscribeIdCfg.exprType,jdbcType=INTEGER},
#{ntcSubscribeIdCfg.matchMethod,jdbcType=INTEGER},
#{ntcSubscribeIdCfg.isHexbin,jdbcType=INTEGER}
)
</insert>
<!-- update cfg_index_info表信息 -->
<update id="updateCfgIndexInfo" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
update cfg_index_info
@@ -721,6 +924,94 @@
</if>
</where>
</update>
<!-- update ntc_subscribe_id_cfg表信息 -->
<update id="updateAvVoipKeywordCfgt" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
update ntc_subscribe_id_cfg
<set >
<trim suffixOverrides=",">
<if test="cfgDesc != null and cfgDesc != ''" >
cfg_desc = #{cfgDesc,jdbcType=VARCHAR},
</if>
<if test="action != null" >
action = #{action,jdbcType=INTEGER},
</if>
<if test="isValid != null" >
is_valid = #{isValid,jdbcType=INTEGER},
</if>
<if test="isAudit != null" >
is_audit = #{isAudit,jdbcType=INTEGER},
</if>
<if test="editorId != null" >
editor_id = #{editorId,jdbcType=INTEGER},
</if>
<if test="editTime != null and editTime != ''" >
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="auditorId != null" >
AUDITOR_ID = #{auditorId,jdbcType=INTEGER},
</if>
<if test="auditTime != null and auditTime != ''" >
AUDIT_TIME = #{auditTime,jdbcType=TIMESTAMP},
</if>
<if test="compileId != null" >
COMPILE_ID = #{compileId,jdbcType=TIMESTAMP},
</if>
<if test="requestId != null" >
request_id = #{requestId,jdbcType=INTEGER},
</if>
<if test="isAreaEffective != null" >
is_area_effective = #{isAreaEffective,jdbcType=INTEGER},
</if>
<if test="classify != null and classify != ''" >
classify = #{classify,jdbcType=VARCHAR},
</if>
<if test="attribute != null and attribute != ''" >
attribute = #{attribute,jdbcType=VARCHAR},
</if>
<if test="lable != null and lable != ''" >
lable = #{lable,jdbcType=VARCHAR},
</if>
<if test="areaEffectiveIds != null" >
area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR},
</if>
<if test="functionId != null" >
function_id = #{functionId,jdbcType=INTEGER},
</if>
<if test="serviceId != null" >
service_id = #{serviceId,jdbcType=INTEGER},
</if>
<if test="ntcSubscribeIdCfg != null and ntcSubscribeIdCfg.cfgKeywords != null and ntcSubscribeIdCfg.cfgKeywords != ''" >
cfg_keywords = #{ntcSubscribeIdCfg.cfgKeywords,jdbcType=VARCHAR},
</if>
<if test="ntcSubscribeIdCfg != null and ntcSubscribeIdCfg.cfgType != null and ntcSubscribeIdCfg.cfgType != ''" >
cfg_type = #{ntcSubscribeIdCfg.cfgType,jdbcType=VARCHAR},
</if>
<if test="ntcSubscribeIdCfg != null and ntcSubscribeIdCfg.cfgRegionCode != null " >
cfg_region_code = #{ntcSubscribeIdCfg.cfgRegionCode,jdbcType=INTEGER},
</if>
<if test="ntcSubscribeIdCfg != null and ntcSubscribeIdCfg.exprType != null " >
expr_type = #{ntcSubscribeIdCfg.exprType,jdbcType=INTEGER},
</if>
<if test="ntcSubscribeIdCfg != null and ntcSubscribeIdCfg.matchMethod != null " >
match_method = #{ntcSubscribeIdCfg.matchMethod,jdbcType=INTEGER},
</if>
<if test="ntcSubscribeIdCfg != null and ntcSubscribeIdCfg.isHexbin != null " >
is_hexbin = #{ntcSubscribeIdCfg.isHexbin,jdbcType=INTEGER},
</if>
</trim>
</set>
<where>
<if test="voipAccount != null and voipAccount.cfgId != null" >
and cfg_id = #{ntcSubscribeIdCfg.cfgId,jdbcType=INTEGER}
</if>
<if test="compileId != null" >
and compile_id = #{compileId,jdbcType=INTEGER}
</if>
<if test="functionId != null" >
and function_id = #{functionId,jdbcType=INTEGER}
</if>
</where>
</update>
<!-- update av_voip_account_cfg表信息 -->
<update id="updateAvVoipAccount" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
update av_voip_account_cfg
@@ -824,8 +1115,23 @@
</if>
</where>
</delete>
<!-- 删除voip subscribe信息 -->
<delete id="deleteAvVoipKeywordCfg" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
delete from ntc_subscribe_id_cfg
<where>
<if test="ntcSubscribeIdCfg != null and ntcSubscribeIdCfg.cfgId != null" >
and cfg_id = #{ntcSubscribeIdCfg.cfgId,jdbcType=INTEGER}
</if>
<if test="compileId != null" >
and compile_id = #{compileId,jdbcType=INTEGER}
</if>
<if test="functionId != null" >
and function_id = #{functionId,jdbcType=INTEGER}
</if>
</where>
</delete>
<!-- 删除voipIp信息 -->
<delete id="deleteAvVoipAccount" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
<delete id="deleteAvVoipAccountCfg" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
delete from av_voip_account_cfg
<where>
<if test="voipAccount != null and voipAccount.cfgId != null" >

View File

@@ -20,6 +20,8 @@ import com.nis.domain.configuration.AvVoipIpCfg;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.BaseStringCfg;
import com.nis.domain.configuration.CfgIndexInfo;
import com.nis.domain.configuration.IpPortCfg;
import com.nis.domain.configuration.NtcSubscribeIdCfg;
import com.nis.domain.maat.MaatCfg;
import com.nis.domain.maat.ToMaatBean;
import com.nis.domain.maat.ToMaatResult;
@@ -35,6 +37,7 @@ import com.nis.util.StringUtil;
import com.nis.util.StringUtils;
import com.nis.web.dao.configuration.AreaIpCfgDao;
import com.nis.web.dao.configuration.AvContentCfgDao;
import com.nis.web.dao.configuration.StringCfgDao;
import com.nis.web.security.UserUtils;
import com.nis.web.service.BaseService;
@@ -51,6 +54,8 @@ public class AvContentCfgService extends BaseService{
protected AvContentCfgDao avContentCfgDao;
@Autowired
protected AreaIpCfgDao areaIpCfgDao;
@Autowired
protected StringCfgDao stringCfgDao;
/********************************voip业务*********************************/
@@ -67,6 +72,19 @@ public class AvContentCfgService extends BaseService{
page.setList(list);
return page;
}
/**
* 查询account分页数据
* @param page 分页对象
* @param entity
* @return
*/
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
@@ -83,199 +101,242 @@ public class AvContentCfgService extends BaseService{
public List<AvVoipAccountCfg> getVoipAccountCfgList(CfgIndexInfo entity) {
return avContentCfgDao.findVoipAccountCfgList(entity);
}
/**
* 公共订阅关键字SubscribeId
* @param cfgIndexInfo
* @return
*/
public List<NtcSubscribeIdCfg> getSubscribeIdCfgList(CfgIndexInfo entity) {
return avContentCfgDao.findSubscribeIdCfgList(entity);
}
/**
* 根据索引表信息获取voipAccountCfg信息
* @param entity
* @return
*/
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());
}
cfg.setNtcSubscribeIdCfgList(ntcSubscribeList);
cfg.setVoipIps(voipIps);
return cfg;
}
public CfgIndexInfo getCfgIndexInfo2(CfgIndexInfo entity) {
CfgIndexInfo cfg=avContentCfgDao.getCfgIndexInfo(entity);
List<AvVoipAccountCfg> voipAccounts=new ArrayList<>();
voipAccounts=getVoipAccountCfgList(entity);
if(voipAccounts ==null || voipAccounts.size() <=0){
voipAccounts.add(new AvVoipAccountCfg());
}
List<AvVoipIpCfg> voipIps=new ArrayList<>();
voipIps=getVoipIpCfgList(entity);
if(voipIps ==null || voipIps.size() <=0){
voipIps.add(new AvVoipIpCfg());
List<NtcSubscribeIdCfg> ntcSubscribeList=getSubscribeIdCfgList(entity);
if(ntcSubscribeList ==null || ntcSubscribeList.size() <=0){
ntcSubscribeList.add(new NtcSubscribeIdCfg());
}
cfg.setVoipAccounts(voipAccounts);
cfg.setVoipIps(voipIps);
cfg.setNtcSubscribeIdCfgList(ntcSubscribeList);
return cfg;
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdateAvVoip(CfgIndexInfo entity,String voipIpIds,String voipAccountIds,String areaCfgIds){
Date createTime=new Date();
public void saveOrUpdateAvVoip(CfgIndexInfo entity){
//设置区域运营商信息
setAreaEffectiveIds(entity);
entity.setIsValid(0);//无效
entity.setIsAudit(0);//未审核
if(entity.getCfgId()==null){
Integer compileId = 0;
try {
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
if(idList!=null && idList.size()>0){
compileId = idList.get(0);
}
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
avContentCfgDao.insertCfgIndexInfo(entity);
if(entity.getVoipIps()!=null){
for (AvVoipIpCfg voipIp : entity.getVoipIps()) {
entity.setVoipIp(voipIp);
avContentCfgDao.insertAvVoipIp(entity);
}
}
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
entity.setNtcSubscribeIdCfg(cfg);
avContentCfgDao.insertAvVoipKeywordCfg(entity);
}
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
} catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
}else{
entity.setEditTime(new Date());
entity.setEditorId(entity.getCurrentUser().getId());
avContentCfgDao.updateCfgIndexInfo(entity);
//无效子配置后,再新增子配置
avContentCfgDao.deleteAvVoipIp(entity);
avContentCfgDao.deleteAvVoipKeywordCfg(entity);
AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
areaIpCfgDao.deleteAreaIpCfg(area);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
if(entity.getVoipIps()!=null&&entity.getVoipIps().size()>0){
for (AvVoipIpCfg voipIp : entity.getVoipIps()) {
entity.setVoipIp(voipIp);
avContentCfgDao.insertAvVoipIp(entity);
}
}
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
entity.setNtcSubscribeIdCfg(cfg);
avContentCfgDao.insertAvVoipKeywordCfg(entity);
}
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
}
}
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void saveOrUpdateAvVoipAccount(CfgIndexInfo entity){
//设置区域运营商信息
setAreaEffectiveIds(entity);
//新增
entity.setIsValid(0);//无效
entity.setIsAudit(0);//未审核
if(entity.getCfgId()==null){
entity.setCreatorId(UserUtils.getUser().getId());
entity.setCreateTime(createTime);
entity.setIsValid(0);
entity.setIsAudit(0);
//调用服务接口获取compileId
List<Integer> compileIds = new ArrayList<Integer>();
Integer compileId = 0;
try {
compileIds = ConfigServiceUtil.getId(1,1);
List<Integer> idList = ConfigServiceUtil.getId(1, 1);
if(idList!=null && idList.size()>0){
compileId = idList.get(0);
}
entity.setCompileId(compileId);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
avContentCfgDao.insertCfgIndexInfo(entity);
if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){
for(AvVoipAccountCfg voipAccount : entity.getVoipAccounts()){
entity.setVoipAccount(voipAccount);
avContentCfgDao.insertAvVoipAccountCfg(entity);
}
}
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
entity.setNtcSubscribeIdCfg(cfg);
avContentCfgDao.insertAvVoipKeywordCfg(entity);
}
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
} catch (Exception e) {
e.printStackTrace();
logger.info("获取编译ID出错");
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>:"+e.getMessage());
}
if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){
entity.setCompileId(compileIds.get(0));
//保存avVoipIp
if(entity.getVoipIps() != null && entity.getVoipIps().size() > 0){
for (AvVoipIpCfg voipIp : entity.getVoipIps()) {
entity.setVoipIp(voipIp);
avContentCfgDao.insertAvVoipIp(entity);
}
}
//保存avVoipAccount
if(entity.getVoipAccounts() != null && entity.getVoipAccounts().size() > 0){
for (AvVoipAccountCfg voipAccount : entity.getVoipAccounts()) {
entity.setVoipAccount(voipAccount);
avContentCfgDao.insertAvVoipAccount(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);
}
}
//保存cfgIndexInfo
avContentCfgDao.insertCfgIndexInfo(entity);
}else{
throw new MaatConvertException("<spring:message code=\"request_service_failed\"/>");
}
//修改
}else{
Date editTime=new Date();
entity.setIsValid(0);
entity.setIsAudit(0);
voipIpIds=!StringUtil.isEmpty(voipIpIds)? voipIpIds+",":"";
voipAccountIds=!StringUtil.isEmpty(voipAccountIds)? voipAccountIds+",":"";
areaCfgIds=!StringUtil.isEmpty(areaCfgIds)? ","+areaCfgIds:"";
//判断voip信息为新增还是修改清楚voipIpIds修改的voipId记录剩下即为需要删除的voipId
if(!StringUtil.isEmpty(entity.getVoipIps())){
for (AvVoipIpCfg voipIp : entity.getVoipIps()) {
if(!StringUtil.isEmpty(voipIp.getCfgId())){
if(voipIpIds.contains(","+voipIp.getCfgId()+",")){
voipIpIds=voipIpIds.replace(voipIp.getCfgId()+",", "");
}
//修改
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(editTime);
entity.setVoipIp(voipIp);
avContentCfgDao.updateAvVoipIp(entity);
}else{
//新增
entity.setCreatorId(UserUtils.getUser().getId());
entity.setCreateTime(createTime);
entity.setVoipIp(voipIp);
avContentCfgDao.insertAvVoipIp(entity);
}
}
}
if(!StringUtil.isEmpty(entity.getVoipAccounts())){
for (AvVoipAccountCfg voipAccount : entity.getVoipAccounts()) {
if(!StringUtil.isEmpty(voipAccount.getCfgId())){
if(voipAccountIds.contains(","+voipAccount.getCfgId()+",")){
voipAccountIds=voipAccountIds.replace(voipAccount.getCfgId()+",", "");
}
//修改
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(editTime);
entity.setVoipAccount(voipAccount);
avContentCfgDao.updateAvVoipAccount(entity);
}else{
//新增
entity.setCreatorId(UserUtils.getUser().getId());
entity.setCreateTime(createTime);
entity.setVoipAccount(voipAccount);
avContentCfgDao.insertAvVoipAccount(entity);
}
}
}
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(editTime);
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType","cfgId"});
areaIpCfgDao.updateAreaIpCfg(areaIpCfg);
}else{
//新增
entity.setCreatorId(UserUtils.getUser().getId());
entity.setCreateTime(createTime);
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode"
,"cfgType"
,"ipType"
,"ipPattern"
,"srcIpAddress"
,"portPattern"
,"srcPort"
,"destPort"
,"protocol"
,"direction"
,"protocolId"
});
areaIpCfgDao.saveAreaIpCfg(areaIpCfg);
}
}
}
//delete 真是删除voipAccount信息
if(!StringUtil.isEmpty(voipAccountIds.replaceAll(",", ""))){
voipAccountIds=voipAccountIds.substring(1,voipAccountIds.length());
for (String cfgId : voipAccountIds.split(",")) {
CfgIndexInfo cfg=new CfgIndexInfo();
AvVoipAccountCfg voipAccountCfg=new AvVoipAccountCfg();
voipAccountCfg.setCfgId(Long.parseLong(cfgId));
cfg.setVoipAccount(voipAccountCfg);
avContentCfgDao.deleteAvVoipAccount(cfg);
}
}
//delete 真是删除voipAccount信息
if(!StringUtil.isEmpty(voipIpIds.replaceAll(",", ""))){
voipIpIds=voipIpIds.substring(1,voipIpIds.length());
for (String cfgId : voipIpIds.split(",")) {
CfgIndexInfo cfg=new CfgIndexInfo();
AvVoipIpCfg voipIpCfg=new AvVoipIpCfg();
voipIpCfg.setCfgId(Long.parseLong(cfgId));
cfg.setVoipIp(voipIpCfg);
avContentCfgDao.deleteAvVoipIp(cfg);
}
}
//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);
}
}
//修改
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(editTime);
entity.setEditTime(new Date());
entity.setEditorId(entity.getCurrentUser().getId());
avContentCfgDao.updateCfgIndexInfo(entity);
//无效子配置后,再新增子配置
avContentCfgDao.deleteAvVoipKeywordCfg(entity);
avContentCfgDao.deleteAvVoipAccountCfg(entity);
AreaIpCfg area = new AreaIpCfg();
area.setCompileId(entity.getCompileId());
area.setFunctionId(entity.getFunctionId());
areaIpCfgDao.deleteAreaIpCfg(area);
entity.setCreateTime(new Date());
entity.setCreatorId(entity.getCurrentUser().getId());
if(entity.getVoipAccounts()!=null&&entity.getVoipAccounts().size()>0){
for (AvVoipAccountCfg voipAccount : entity.getVoipAccounts()) {
entity.setVoipAccount(voipAccount);
avContentCfgDao.insertAvVoipAccountCfg(entity);
}
}
if(entity.getNtcSubscribeIdCfgList()!=null){
for(NtcSubscribeIdCfg cfg:entity.getNtcSubscribeIdCfgList()){
if(StringUtils.isNotBlank(cfg.getCfgKeywords())){
entity.setNtcSubscribeIdCfg(cfg);
avContentCfgDao.insertAvVoipKeywordCfg(entity);
}
}
}
//保存区域IP信息
if(entity.getAreaCfg()!=null){
for(AreaIpCfg cfg:entity.getAreaCfg()){
cfg.initDefaultValue();
BeanUtils.copyProperties(entity, cfg,new String[]{"cfgDesc","cfgRegionCode","cfgType"});
areaIpCfgDao.saveAreaIpCfg(cfg);
}
}
}
}
/**
*
* @param isAudit
* @param isValid
* @param ids compileIds
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void updateAvVoipValid(Integer isAudit,Integer isValid,String compileIds,Integer functionId){
CfgIndexInfo entity = new CfgIndexInfo();
String[] idArray = compileIds.split(",");
for(String id :idArray){
entity.setCompileId(Integer.parseInt(id));
entity.setFunctionId(functionId);
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(new Date());
avContentCfgDao.updateAvVoipIp(entity);
avContentCfgDao.updateAvVoipKeywordCfgt(entity);
avContentCfgDao.updateCfgIndexInfo(entity);
AreaIpCfg areaIpCfg=new AreaIpCfg();
BeanUtils.copyProperties(entity, areaIpCfg);
areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg);
}
}
/**
@@ -285,9 +346,9 @@ public class AvContentCfgService extends BaseService{
* @param ids compileIds
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void updateAvVoipValid(Integer isAudit,Integer isValid,String ids,Integer functionId){
public void updateAvVoipAccountValid(Integer isAudit,Integer isValid,String compileIds,Integer functionId){
CfgIndexInfo entity = new CfgIndexInfo();
String[] idArray = ids.split(",");
String[] idArray = compileIds.split(",");
for(String id :idArray){
entity.setCompileId(Integer.parseInt(id));
entity.setFunctionId(functionId);
@@ -295,8 +356,8 @@ public class AvContentCfgService extends BaseService{
entity.setIsValid(isValid);
entity.setEditorId(UserUtils.getUser().getId());
entity.setEditTime(new Date());
avContentCfgDao.updateAvVoipIp(entity);
avContentCfgDao.updateAvVoipAccount(entity);
avContentCfgDao.updateAvVoipKeywordCfgt(entity);
avContentCfgDao.updateCfgIndexInfo(entity);
AreaIpCfg areaIpCfg=new AreaIpCfg();
BeanUtils.copyProperties(entity, areaIpCfg);
@@ -316,7 +377,7 @@ public class AvContentCfgService extends BaseService{
List<CfgIndexInfo> list = new ArrayList();
List<AvVoipIpCfg> voipIpList = new ArrayList();
List<AvVoipAccountCfg> voipAccountList = new ArrayList();
List <NtcSubscribeIdCfg> ntcList = new ArrayList();
List<AreaIpCfg> areaIpCfgList = new ArrayList();
CfgIndexInfo searchCfg=new CfgIndexInfo();
@@ -328,16 +389,16 @@ public class AvContentCfgService extends BaseService{
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(auditTime);
avContentCfgDao.updateAvVoipIp(entity);
avContentCfgDao.updateAvVoipAccount(entity);
avContentCfgDao.updateAvVoipKeywordCfgt(entity);
avContentCfgDao.updateCfgIndexInfo(entity);
AreaIpCfg areaIpCfg=new AreaIpCfg();
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType","cfgId"});
areaIpCfgDao.updateAreaIpCfg(areaIpCfg);
voipIpList=avContentCfgDao.findVoipIpCfgList(entity);
voipAccountList=avContentCfgDao.findVoipAccountCfgList(entity);
ntcList=avContentCfgDao.findSubscribeIdCfgList(entity);
areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
ToMaatBean maatBean = new ToMaatBean();
@@ -357,8 +418,122 @@ public class AvContentCfgService extends BaseService{
ipRegionList=ipMap.get("dstList");
}
if(!StringUtil.isEmpty(voipAccountList)){
Map<String,List> accountMap = cfgConvert(strRegionList,voipAccountList,2,entity,groupRelationList);
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");
}
}
//构造提交综合服务参数格式,一条配置提交一次综合服务
if(isAudit==1){
maatCfg.initDefaultValue();
BeanUtils.copyProperties(entity, maatCfg);
maatCfg.setAction(entity.getAction());
maatCfg.setAuditTime(auditTime);
maatCfg.setIpRegionList(ipRegionList);
maatCfg.setStrRegionList(strRegionList);
maatCfg.setNumRegionList(numRegionList);
maatCfg.setDigestRegionList(digestRegionList);
maatCfg.setGroupRelationList(groupRelationList);
maatCfg.setGroupNum(groupRelationList.size());
maatCfg.setAreaIpRegionList(areaIpRegionList);
maatCfg.setIsValid(entity.getIsValid());
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(auditTime);
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.INSERT_ACTION);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("voip IP配置下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
logger.info("voip IP配置下发响应信息"+result.getMsg());
}else if(isAudit==3){
maatCfg.setCompileId(entity.getCompileId());
maatCfg.setServiceId(entity.getServiceId());
maatCfg.setIsValid(0);//无效
configCompileList.add(maatCfg);
maatBean.setConfigCompileList(configCompileList);
maatBean.setAuditTime(auditTime);
maatBean.setCreatorName(entity.getCurrentUser().getName());
maatBean.setVersion(Constants.MAAT_VERSION);
maatBean.setOpAction(Constants.UPDATE_ACTION);
//调用服务接口取消配置
String json=gsonToJson(maatBean);
logger.info("voip IP配置下发配置参数"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.put(json,1);
logger.info("voip IP配置取消配置响应信息"+result.getMsg());
}
}
/********************************voip业务*********************************/
/**
*
* @param isAudit
* @param isValid
* @param ids 编译Id
* @param functionId
*/
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
public void auditAvVoipAccount(Integer isAudit,Integer isValid,Integer functionId,String compileId,Date auditTime){
CfgIndexInfo entity = new CfgIndexInfo();
List<CfgIndexInfo> list = new ArrayList();
List<AvVoipAccountCfg> accountList = new ArrayList();
List <NtcSubscribeIdCfg> ntcList = new ArrayList();
List<AreaIpCfg> areaIpCfgList = new ArrayList();
CfgIndexInfo searchCfg=new CfgIndexInfo();
searchCfg.setCompileId(Integer.parseInt(compileId));
entity = avContentCfgDao.getCfgIndexInfo(searchCfg);
entity.setIsAudit(isAudit);
entity.setIsValid(isValid);
entity.setAuditorId(UserUtils.getUser().getId());
entity.setAuditTime(auditTime);
avContentCfgDao.updateAvVoipAccount(entity);
avContentCfgDao.updateAvVoipKeywordCfgt(entity);
avContentCfgDao.updateCfgIndexInfo(entity);
AreaIpCfg areaIpCfg=new AreaIpCfg();
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType","cfgId"});
areaIpCfgDao.updateAreaIpCfg(areaIpCfg);
ntcList=avContentCfgDao.findSubscribeIdCfgList(entity);
accountList=avContentCfgDao.findVoipAccountCfgList(entity);
areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
ToMaatBean maatBean = new ToMaatBean();
MaatCfg maatCfg = new MaatCfg();
List<MaatCfg> configCompileList = new ArrayList();
List<GroupCfg> groupRelationList = new ArrayList();
List<IpCfg> ipRegionList = new ArrayList();
List<StringCfg> strRegionList = new ArrayList();
List<NumBoundaryCfg> numRegionList = new ArrayList();
List<DigestCfg> digestRegionList = new ArrayList();
List<IpCfg> areaIpRegionList = new ArrayList();
if(isAudit==1){
if(!StringUtil.isEmpty(ntcList)){
Map<String,List> accountMap = cfgConvert(strRegionList,ntcList,2,entity,groupRelationList);
groupRelationList=accountMap.get("groupList");
strRegionList=accountMap.get("dstList");
}
if(!StringUtil.isEmpty(accountList)){
Map<String,List> accountMap = cfgConvert(strRegionList,accountList,2,entity,groupRelationList);
groupRelationList=accountMap.get("groupList");
strRegionList=accountMap.get("dstList");
}
@@ -391,11 +566,12 @@ public class AvContentCfgService extends BaseService{
maatBean.setOpAction(Constants.INSERT_ACTION);
//调用服务接口下发配置数据
String json=gsonToJson(maatBean);
logger.info("voip配置下发配置参数"+json);
logger.info("voip Account配置下发配置参数:"+json);
System.err.println(json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.postMaatCfg(json);
logger.info("voip配置下发响应信息"+result.getMsg());
logger.info("voip Account配置下发响应信息:"+result.getMsg());
}else if(isAudit==3){
maatCfg.setCompileId(entity.getCompileId());
maatCfg.setServiceId(entity.getServiceId());
@@ -408,10 +584,10 @@ public class AvContentCfgService extends BaseService{
maatBean.setOpAction(Constants.UPDATE_ACTION);
//调用服务接口取消配置
String json=gsonToJson(maatBean);
logger.info("voip配置下发配置参数"+json);
logger.info("voip Account配置下发配置参数:"+json);
//调用服务接口下发配置
ToMaatResult result = ConfigServiceUtil.put(json,1);
logger.info("voip配置取消配置响应信息"+result.getMsg());
logger.info("voip Account配置取消配置响应信息:"+result.getMsg());
}

View File

@@ -30,6 +30,7 @@
<mapping path="/nis/report/ajax*" exclue="true"/>
<mapping path="/nis/basicprotocol/ajax*" exclue="true"/>
<mapping path="/nis/encryptedtunnelbehav/ajax*" exclue="true"/>
<mapping path="/nis/ntc/av/ajax*" exclue="true"/>
<!-- 对同一路径,启用多个装饰器 -->
<mapping>
<path>/articles/*</path>

View File

@@ -0,0 +1,311 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title><spring:message code="${cfgName}"></spring:message></title>
<style type="text/css">
.boxSolid {
border: 1px solid #eeeeee
}
</style>
<script type="text/javascript">
$(document)
.ready(
function() {
$("#cancel").on("click", function() {
window.history.back();
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
$("#cfgFrom").validate(
{ errorPlacement : function(error, element) {
if($(element).parents().hasClass("tagsinput")){
$(element).parents(".col-md-6").next("div").append(error);
}else{
$(element).parents(".form-group").find(
"div[for='"
+ element.attr("name")
+ "']").append(error);
}
},
submitHandler : function(form) {
var flag = true;
//代表所有业务都隐藏了,提示必须增加一种业务数据
if($(".boxSolid").length ==$(".boxSolid.hidden").length){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return;
}
//代表所有区域都隐藏了,提示必须增加个区域信息
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click();
if($("#areaIp").hasClass("hidden")) $("#areaIsp").find(".glyphicon-plus").click();
top.$.jBox.tip("<spring:message code='one_more_area'/>", "<spring:message code='info'/>");
return;
}
$(".boxSolid:visible").find("input[name$='cfgKeywords']").each(function(){
if($(this).val()==''){
$(this).parents(".form-group").find(
"div[for='"
+ $(this).attr("name")
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$("#keywordError").text()+"</label>");
flag = false;
}
})
//keywords非空校验完成校验二进制字符串
$(".boxSolid:visible").find("select[name$='isHexbin']").each(function(){
var isHexbin=$(this).val();
if(isHexbin == 1){ //十六进制
var keywords=$("input[name$='"+$(this).attr("name").replace("isHexbin","cfgKeywords")+"']").val();
if(keywords != ''){
if(!(/^([0-9|a-f|A-F]*)$/.test(keywords))){
$(this).parents(".boxSolid").find(
"div[for='"
+ $(this).attr("name").replace("isHexbin","cfgKeywords")
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$.validator.messages.hexCheck+"</label>");
flag = false;
}
}
}
});
var flag1=validateInvisibleCharTag();
if(flag){
flag=flag1;
}
if(flag){
//将disable属性的元素删除
$(".disabled").each(function(){
$(this).remove();
});
$("input[name$='exprType']").attr("disabled",false);
loading('onloading...');
form.submit();
}else{
return;
}
},
errorContainer : "#messageBox",
});
//业务内容增加
/* $("span[title='add']").on("click", function() {
$(".ipPort0").removeClass("hidden");
}); */
});
//业务窗口打开
var addContent = function(obj, contentClassName) {
var showDiv = $(obj).parent().parent().next();
$(showDiv).removeClass("hidden").removeClass(
"disabled");
/* $("."+contentClassName+"0").find("input,select").each(function(){
$(this).removeAttr("disabled");
}); */
$(obj).addClass("hidden");
}
//业务窗口关闭
var delContent = function(contentClassName, addBtnClassName) {
$("." + contentClassName).addClass("hidden").addClass("disabled");
/* $("."+contentClassName).find("input,select").each(function(){
$(this).attr("disabled","true");
}); */
$("." + addBtnClassName).removeClass("hidden");
}
</script>
</head>
<body>
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<spring:message code="av_voip_account_control"></spring:message>
</h3>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-gift"></i>
<c:if test="${empty _cfg.cfgId}">
<spring:message code="add"></spring:message>
</c:if>
<c:if test="${not empty _cfg.cfgId}">
<spring:message code="edit"></spring:message>
</c:if>
</div>
</div>
<div class="portlet-body form">
<!-- BEGIN FORM-->
<form id="cfgFrom" action="${ctx}/ntc/av/saveAccountVoip"
method="post" class="form-horizontal">
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="serviceId" name="serviceId"
value="${_cfg.serviceId}">
<div class="form-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message
code="config_describe" /></label>
<div class="col-md-6">
<input class="form-control" type="text" name="cfgDesc"
value="${_cfg.cfgDesc}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message
code="action" /></label>
<div class="col-md-6">
<c:forEach items="${serviceList}" var="service"
varStatus="satus">
<label class="radio-inline"> <c:if
test="${_cfg.functionId eq service.functionId}">
<input type="radio" name="action"
serviceId="${service.serviceId }"
protocolId="${service.protocolId }"
value="${service.action }" class="required action"
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq service.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</c:if>
</label>
</c:forEach>
</div>
<div for="action"></div>
</div>
</div>
</div>
<c:set var="accountCfgIndex" value="0"></c:set>
<c:set var="strCfgIndex" value="0"></c:set>
<c:forEach items="${regionList}" var="region" varStatus="status">
<c:if test="${region.regionType eq 2 }">
<c:if test="${region.configRegionValue eq 'MM_VOIP_ACCOUNT' }">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section">
<spring:message code="${region.configRegionValue}" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:set var="cfgName" value="voipAccounts[${accountCfgIndex}]"></c:set>
<%-- <c:set var="regionValue" value="${region.configRegionValue}"></c:set> --%>
<c:choose>
<c:when test="${fn:length(_cfg.voipAccounts)>0}">
<c:set var="isBreak" value="false" ></c:set>
<c:forEach items="${_cfg.voipAccounts}" var="cfg">
<c:choose>
<c:when test="${region.configRegionValue eq cfg.cfgType and !isBreak}">
<div class="row boxSolid ${tabName}${status.index}">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="isBreak" value="true" ></c:set>
<c:set var="accountCfgIndex" value="${accountCfgIndex+1 }"></c:set>
</c:when>
</c:choose>
</c:forEach>
<c:if test="${!isBreak}">
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="accountCfgIndex" value="${accountCfgIndex+1 }"></c:set>
</c:if>
</c:when>
<c:otherwise>
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="accountCfgIndex" value="${accountCfgIndex+1 }"></c:set>
</c:otherwise>
</c:choose>
</c:if>
<!-- 关键字 -->
<c:if test="${region.configRegionValue eq 'NTC_SUBSCRIBE_ID' }">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section">
<spring:message code="${region.configRegionValue}" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${strCfgIndex}]"></c:set>
<c:choose>
<c:when test="${fn:length(_cfg.ntcSubscribeIdCfgList)>0}">
<c:set var="isBreak" value="false" ></c:set>
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:choose>
<c:when test="${region.configRegionValue eq cfg.cfgType and !isBreak}">
<div class="row boxSolid ${tabName}${status.index}">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="isBreak" value="true" ></c:set>
<c:set var="strCfgIndex" value="${strCfgIndex+1 }"></c:set>
</c:when>
</c:choose>
</c:forEach>
<c:if test="${!isBreak}">
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="strCfgIndex" value="${strCfgIndex+1 }"></c:set>
</c:if>
</c:when>
<c:otherwise>
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="strCfgIndex" value="${strCfgIndex+1 }"></c:set>
</c:otherwise>
</c:choose>
</c:if>
</c:if>
</c:forEach>
<br>
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
<br>
<%@include file="/WEB-INF/include/form/basicInfo.jsp"%>
<div class="form-actions">
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
<button id="save" type="submit" class="btn green">
<spring:message code="submit" />
</button>
<button id="cancel" type="button" class="btn default">
<spring:message code="cancel" />
</button>
</div>
</div>
</div>
<div class="col-md-6"></div>
</div>
</div>
</div>
</form>
<!-- END FORM-->
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,667 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title><spring:message code="${cfgName}"></spring:message></title>
<link href="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/css/bootstrap-select.min.css" rel="stylesheet"/>
<link href="${pageContext.request.contextPath}/static/global/plugins/treeTable/themes/vsStyle/treeTable.min.css" rel="stylesheet" type="text/css" />
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/bootstrap-select.min.js"></script>
<c:choose>
<c:when test="${cookie.Language.value eq 'zh_CN'}">
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/i18n/defaults-zh_CN.min.js"></script>
</c:when>
<c:when test="${cookie.Language.value eq 'en'}">
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/i18n/defaults-en_US.min.js"></script>
</c:when>
<c:when test="${cookie.Language.value eq 'ru_RU'}">
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/i18n/defaults-ru_RU.min.js"></script>
</c:when>
<c:otherwise>
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/i18n/defaults-en_US.min.js"></script>
</c:otherwise>
</c:choose>
<script>
$(document).ready(function() {
//搜索框提示语初始化
if("${cfg.cfgDesc}"){
$("#intype").val("${cfg.cfgDesc}");
}else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){
$("#intype").val("${cfg.ntcSubscribeIdCfg.cfgKeywords}");
}else if("${cfg.voipAccount.cfgKeywords}"){
$("#intype").val("${cfg.voipAccount.cfgKeywords}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
$("#seltype").change(function(){
$("#intype").attr("placeholder","<spring:message code='input'/> "+$(this).find("option:selected").text());
});
//筛选功能初始化
filterActionInit();
$("#isAudit").change(function(){
page();
});
//reset
$("#resetBtn").on("click",function(){
$("select.selectpicker").each(function(){
$(this).selectpicker('val',$(this).find('option:first').val());
$(this).find("option").attr("selected",false);
$(this).find("option:first").attr("selected",true);
});
$(".Wdate").attr("value",'');
$("#level").attr("value",'');
$("#searchForm")[0].reset();
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
});
//异步获取voip相关信息
$("span[id^=open]").click(function(){
var openId=$(this).attr("id");
var closeId=$(this).attr("id").replace("open","close");
var index=$(this).attr("id").replace("open","");
$("#"+openId).hide();
$("#"+closeId).show();
var compileId=$(this).attr("compileId");
var cfgId=$(this).attr("cfgId");
var hasSubscribe=false;
var hasAccount=false;
if($("#"+openId).parent().parent().next("tr").hasClass("child")){
$("#"+openId).parent().parent().next("tr").show();
}else{
$.ajax({
type:'post',
async:false,
url:'${ctx}/ntc/av/ajaxVoipAccountInfo',
data:{"compileId":compileId,"cfgId":cfgId},
success:function(data){
var voipIpCfgTab="<tr class='child'>"+
"<td style='border-right: 1px solid #FFFFFF;'>"+
"<input type='checkbox' hidden='hidden'/>"+
"</td>"+
"<td colspan='"+($(".table tr").eq(0).children("th").length-1)+"'>";
var html="";
html+="<div class='row'>";
/* 订阅关键字 */
if(data.subscribe.length >0){
hasSubscribe=true;
html+="<div id='subscribeTitle"+index+"' onclick='switchInfo(\"account\","+index+")' class='col-md-1 tabInfo badge-info' >";
html+="<spring:message code='NTC_SUBSCRIBE_ID'/>";
html+="<i id='subscribeDown"+index+"' class='fa fa-angle-double-down '></i>";
html+="<i id='subscribeUp"+index+"' class='fa fa-angle-double-up ' style='display:none'></i>";
html+="</div>";
}
if(data.account.length >0){
hasAccount=true;
html+="<div id='accountTitle"+index+"' onclick='switchInfo(\"subscribe\","+index+")' class='col-md-1 tabInfo' >";
html+="<spring:message code='av_voip_account_title'/>";
html+="<i id='accountDown"+index+"' class='fa fa-angle-double-down '></i>";
html+="<i id='accountUp"+index+"' class='fa fa-angle-double-up ' style='display:none'></i>";
html+="</div>";
}
html+="</div>";
//subscribe信息
if(data.subscribe.length > 0){
html+="<div id='subscribeInfo"+index+"' class='content'>";
$.each(data.subscribe,function(index,item){
console.log(item.cfgKeywords);
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='NTC_SUBSCRIBE_ID'/></label>";
html+="<label>"
html+=item.cfgKeywords.replace(/\*\*\*and\*\*\*/g , " ");
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='whether_hexbinary'/></label>";
html+="<label>"
if(item.isHexbin==1){
html+="<spring:message code='hex_binary'/>"
}
if(item.isHexbin==2){
html+="<spring:message code='case_sensitive_nohex'/>"
}
if(item.isHexbin==0){
html+="<spring:message code='case_insensitive_nohex'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='expression_type'/></label>";
html+="<label>"
if(item.exprType==1){
html+="<spring:message code='and_expression'/>"
}
if(item.exprType==0){
html+="<spring:message code='null_expression'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='match_method'/></label>";
html+="<label>"
if(item.matchMethod==0){
html+="<spring:message code='substring_match'/>"
}
if(item.matchMethod==1){
html+="<spring:message code='right_match'/>"
}
if(item.matchMethod==2){
html+="<spring:message code='left_match'/>"
}
if(item.matchMethod==3){
html+="<spring:message code='exactly_match'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
/* if(index < (data.ip.length-1) && index != 0){
alert("下一行");
}
html+="<h5 class='page-header'></h5>";*/
})
html+="</div>";
}
//account信息
if(data.account.length > 0){
html+="<div id='accountInfo"+index+"' class='content' style='display:none'>";
$.each(data.account,function(index,item){
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='account'/></label>";
html+="<label>"
html+=item.cfgKeywords.replace(/\*\*\*and\*\*\*/g , " ");
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='whether_hexbinary'/></label>";
html+="<label>"
if(item.isHexbin==1){
html+="<spring:message code='hex_binary'/>"
}
if(item.isHexbin==2){
html+="<spring:message code='case_sensitive_nohex'/>"
}
if(item.isHexbin==0){
html+="<spring:message code='case_insensitive_nohex'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='expression_type'/></label>";
html+="<label>"
if(item.exprType==1){
html+="<spring:message code='and_expression'/>"
}
if(item.exprType==0){
html+="<spring:message code='null_expression'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='match_method'/></label>";
html+="<label>"
if(item.matchMethod==0){
html+="<spring:message code='substring_match'/>"
}
if(item.matchMethod==1){
html+="<spring:message code='right_match'/>"
}
if(item.matchMethod==2){
html+="<spring:message code='left_match'/>"
}
if(item.matchMethod==3){
html+="<spring:message code='exactly_match'/>"
}
html+="</label>";
html+="</div>";
html+="</div>";
html+="</div>";
/* if(index < (data.ip.length-1) && index != 0){
alert("下一行");
}
html+="<h5 class='page-header'></h5>";*/
})
html+="</div>";
}
voipIpCfgTab=voipIpCfgTab+html;
voipIpCfgTab+="</td>";
voipIpCfgTab+="</tr>";
$("#"+openId).parent().parent().after(voipIpCfgTab);
if(hasSubscribe && ! hasAccount){
switchInfo("account",index);
}
if(hasAccount && ! hasSubscribe){
switchInfo("subscribe",index);
}
}
});
}
});
$("span[id^=close]").on("click",function(){
var closeId=$(this).attr("id");
var openId=$(this).attr("id").replace("close","open");
$("#"+closeId).hide();
$("#"+openId).show();
$("#"+closeId).parent().parent().next("tr").hide();
});
});
function switchInfo(flag,index){
if("account" ==flag){
//关闭account信息
$("#accountInfo"+index).hide();
$("#downAccount"+index).hide();
$("#accountTitle"+index).removeClass("badge-info");
$("#subscribeInfo"+index).show();
$("#subscribeDown"+index).show();
$("#accountUp"+index).show();
$("#accountDown"+index).hide();
$("#subscribeUp"+index).hide();
$("#subscribeTitle"+index).addClass("badge-info");
}else{
//关闭subscribe信息
$("#subscribeInfo"+index).hide();
$("#downsubscribe"+index).hide();
$("#subscribeTitle"+index).removeClass("badge-info");
$("#accountInfo"+index).show();
$("#accountDown"+index).show();
$("#subscribeUp"+index).show();
$("#subscribeDown"+index).hide();
$("#accountUp"+index).hide();
$("#accountTitle"+index).addClass("badge-info");
}
}
</script>
</head>
<body>
<div class="page-content">
<div class="theme-panel hidden-xs hidden-sm">
<shiro:hasPermission name="avVoip:config">
<button type="button" class="btn btn-primary"
onClick="javascript:window.location='${ctx}/ntc/av/voipAccountForm?functionId=${cfg.functionId}'">
<i class="fa fa-plus"></i>
<spring:message code="add"></spring:message></button>
</shiro:hasPermission>
</div>
<h3 class="page-title">
<spring:message code="av_voip_account_control"/>
<small><spring:message code="date_list"/></small>
</h3>
<h5 class="page-header"></h5>
<div class="col-md-12">
<div class="portlet">
<div class="portlet-body">
<div class="row" >
<form:form id="searchForm" modelAttribute="cfg" action="${ctx}/ntc/av/voipAccountList?functionId=${cfg.functionId}" method="post" class="form-search">
<input id="functionId" name="functionId" type="hidden" value="${cfg.functionId}"/>
<input id="audit" name="audit" type="hidden" value="${audit}"/>
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}"
callback="page();" />
<!-- 筛选按钮展开状态-->
<input id="isFilterAction" name="isFilterAction" type="hidden" value="${cfg.isFilterAction }"/>
<!-- 搜索内容与操作按钮栏 -->
<div class="col-md-12">
<div class="pull-left">
<c:set var="state"><spring:message code='state'/></c:set>
<form:select path="isAudit" class="selectpicker select2 input-small">
<form:option value=""><spring:message code="all_states"/></form:option>
<form:option value="0"><spring:message code="created"></spring:message></form:option>
<form:option value="1"><spring:message code="approved"></spring:message></form:option>
<form:option value="2"><spring:message code="unapproved"></spring:message></form:option>
<form:option value="3"><spring:message code="cancel_approved"></spring:message></form:option>
</form:select>
</div>
<div class="pull-left">
<div class="input-group">
<div class="input-group-btn">
<form:select path="seltype" class="selectpicker select2 input-small" >
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="voipAccount.cfgKeywords"><spring:message code="account"/></form:option>
<form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="NTC_SUBSCRIBE_ID"/></form:option>
</form:select>
</div>
<input id="intype" class="form-control input-small" type="text" value="">
</div>
</div>
<div class="pull-left">
<button type="button" class="btn blue" onClick="return page()"> <i class="fa fa-search"></i> <spring:message code="search"/> </button>
<button type="button" class="btn btn-default" id="resetBtn"> <i class="fa fa-refresh"></i> <spring:message code="reset"/> </button>
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/> <i class="fa fa-angle-double-down"></i></button>
</div>
<div class="pull-right">
<shiro:hasPermission name="avVoip:config">
<sys:delRow url="${ctx}/ntc/av/voipAccountForm" id="contentTable" label="update"></sys:delRow>
<sys:delRow url="${ctx}/ntc/av/updateAvVoipAccountValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
</shiro:hasPermission>
<%-- <sys:delRow url="${ctx}/ntc/av/voipExport?functionId=${cfg.functionId }" id="contentTable" label="export" maxRow="${page.maxExportSize }"></sys:delRow> --%>
<shiro:hasPermission name="avVoip:confirm">
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-wrench"></i> <spring:message code="examine"></spring:message>
<i class="fa fa-angle-down"></i>
</button>
<ul class="dropdown-menu pull-right">
<li><sys:delRow url="${ctx}/ntc/av/auditAvVoipAccount?isAudit=1&isValid=1&functionId=${cfg.functionId }" id="contentTable" label="approved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/ntc/av/auditAvVoipAccount?isAudit=2&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="unapproved"></sys:delRow></li>
<li><sys:delRow url="${ctx}/ntc/av/auditAvVoipAccount?isAudit=3&isValid=0&functionId=${cfg.functionId }" id="contentTable" label="cancelPass"></sys:delRow></li>
</ul>
</div>
</shiro:hasPermission>
<a class="btn btn-icon-only btn-default setfields tooltips"
data-container="body" data-placement="top" data-original-title=<spring:message code="custom_columns"/> href="javascript:;">
<i class="icon-wrench"></i>
</a>
</div>
</div>
<!-- /搜索内容与操作按钮栏 -->
<!-- 筛选搜索内容栏默认隐藏-->
<div class="col-md-12 filter-action-select-panle hide" >
<div class="row">
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='request_number'/></label>
<c:set var="select"><spring:message code='select'/></c:set>
<form:select path="requestId" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${requestInfos}" var="requestInfo" >
<form:option value="${requestInfo.id}"><spring:message code="${requestInfo.requestTitle}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='type'/></label>
<form:select path="classify" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${fls}" var="fl" >
<form:option value="${fl.serviceDictId}"><spring:message code="${fl.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='attribute'/></label>
<c:set var="select"><spring:message code='select'/></c:set>
<form:select path="attribute" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${xzs}" var="xz" >
<form:option value="${xz.serviceDictId}"><spring:message code="${xz.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label class="control-label"><spring:message code='label'/></label>
<form:select path="lable" class="selectpicker form-control" data-live-search="true" data-live-search-placeholder="search">
<form:option value=""><spring:message code="select"/></form:option>
<c:forEach items="${lables}" var="lable" >
<form:option value="${lable.serviceDictId}"><spring:message code="${lable.itemValue}"></spring:message></form:option>
</c:forEach>
</form:select>
</div>
</div>
</div>
<div class="row">
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="config_time"/></label>
<input name="search_create_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value='${cfg.search_create_time_start}' pattern='yyyy-MM-dd HH:mm:ss'/>" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input name="search_create_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_create_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="edit_time"/></label>
<input name="search_edit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_edit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input name="search_edit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_edit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label><spring:message code="audit_time"/></label>
<input name="search_audit_time_start" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_audit_time_start}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label>&nbsp;</label>
<input name="search_audit_time_end" type="text" readonly="readonly" maxlength="20" class="form-control Wdate"
value="<fmt:formatDate value="${cfg.search_audit_time_end}" pattern="yyyy-MM-dd HH:mm:ss"/>" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/>
</div>
</div>
</div>
</div>
<!-- /筛选搜索内容栏 结束-->
</form:form>
</div>
<div class="table-responsive">
<sys:message content="${message}" />
<table id="contentTable" class="table table-striped table-bordered table-condensed text-nowrap">
<thead>
<tr>
<th><input type="checkbox" class="i-checks" id="checkAll"></th>
<th class="cfgDesc"><spring:message code="config_describe"/></th>
<th><spring:message code="block_type"/></th>
<th><spring:message code="whether_area_block"/></th>
<th><spring:message code="letter"/></th>
<th><spring:message code="classification"/></th>
<th><spring:message code="attribute"/></th>
<th><spring:message code="label"/></th>
<th><spring:message code="valid_identifier"/></th>
<th><spring:message code="is_audit"/></th>
<th><spring:message code="log_total"/></th>
<th><spring:message code="creator"/></th>
<th class="sort-column r.create_time"><spring:message code="config_time"/></th>
<th><spring:message code="editor"/></th>
<th class="sort-column r.edit_time"><spring:message code="edit_time"/></th>
<th><spring:message code="auditor"/></th>
<th class="sort-column r.audit_time"><spring:message code="audit_time"/></th>
</tr>
</thead>
<tbody>
<c:forEach items="${page.list }" var="indexCfg" varStatus="status" step="1">
<tr>
<td>
<span id="open${status.index}" class="" compileId="${indexCfg.compileId}" cfgId="${indexCfg.cfgId}"> ▷ </span><span style="display: none" id="close${status.index}" > ▼ </span>
<input type="checkbox" class="i-checks child-checks" id="${indexCfg.cfgId}" compileId="${indexCfg.compileId}" value="${indexCfg.isAudit}">
</td>
<td>${indexCfg.cfgDesc }</td>
<td>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq indexCfg.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</td>
<td>
<c:if test="${indexCfg.isAreaEffective==0}"><spring:message code="no"/></c:if>
<c:if test="${indexCfg.isAreaEffective==1}">
<a href="javascript:viewAreaInfo('${ctx}','${indexCfg.areaEffectiveIds }','${indexCfg.compileId }')" >
<spring:message code="yes"/>
</a>
</c:if>
</td>
<td>${indexCfg.requestName }</td>
<td >
<c:set var="classify"></c:set>
<c:forEach items="${fn:split(indexCfg.classify,',')}" var="classifyId" varStatus="status">
<c:forEach items="${fls}" var="fl">
<c:if test="${classifyId eq fn:trim(fl.serviceDictId)}">
<c:if test="${status.index+1 eq 1}">
<c:set var="classify" value="${fl.itemValue}"></c:set>
</c:if>
<c:if test="${status.index+1 ne 1}">
<c:set var="classify" value="${classify},${fl.itemValue}"></c:set>
</c:if>
</c:if>
</c:forEach>
</c:forEach>
<a href="javascript:;" data-original-title="${classify}"
class="tooltips" data-flag="false" data-html="true" data-placement="top">
${fns:abbr(classify,20)}
</a>
</td>
<td>
<c:set var="attribute"></c:set>
<c:forEach items="${fn:split(indexCfg.attribute,',')}" var="attributeId" varStatus="status">
<c:forEach items="${xzs}" var="xz">
<c:if test="${attributeId eq fn:trim(xz.serviceDictId)}">
<c:if test="${status.index+1 eq 1}">
<c:set var="attribute" value="${xz.itemValue}"></c:set>
</c:if>
<c:if test="${status.index+1 ne 1}">
<c:set var="attribute" value="${attribute},${xz.itemValue}"></c:set>
</c:if>
</c:if>
</c:forEach>
</c:forEach>
<a href="javascript:;" data-original-title="${attribute}"
class="tooltips" data-flag="false" data-html="true" data-placement="top">
${fns:abbr(attribute,20)}
</a>
</td>
<td>
<c:set var="lableInfo"></c:set>
<c:forEach items="${fn:split(indexCfg.lable,',')}" var="lableId" varStatus="status">
<c:forEach items="${lables}" var="lable">
<c:if test="${lableId eq fn:trim(lable.serviceDictId)}">
<c:if test="${status.index+1 eq 1}">
<c:set var="lableInfo" value="${lable.itemValue}"></c:set>
</c:if>
<c:if test="${status.index+1 ne 1}">
<c:set var="lableInfo" value="${lableInfo},${lable.itemValue}"></c:set>
</c:if>
</c:if>
</c:forEach>
</c:forEach>
<a href="javascript:;" data-original-title="${lableInfo}"
class="tooltips" data-flag="false" data-html="true" data-placement="top">
${fns:abbr(lableInfo,20)}
</a>
</td>
<td>
<c:if test="${indexCfg.isValid==0}"><spring:message code="no"/></c:if>
<c:if test="${indexCfg.isValid==1}"><spring:message code="yes"/></c:if>
<c:if test="${indexCfg.isValid==-1}"><spring:message code="deleted"/></c:if>
</td>
<td>
<c:choose>
<c:when test="${indexCfg.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
<c:when test="${indexCfg.isAudit eq '1'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:when>
<c:when test="${indexCfg.isAudit eq '2'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:when>
<c:when test="${indexCfg.isAudit eq '3'}"><span class="label label-warning"><spring:message code="cancel_approved"></spring:message></span></c:when>
</c:choose>
</td>
<td functionId="${indexCfg.functionId}" compileId="${indexCfg.compileId}" action="${indexCfg.action}"><div class="loading-total"></div></td>
<td>${indexCfg.creatorName }</td>
<td><fmt:formatDate value="${indexCfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${indexCfg.editorName }</td>
<td><fmt:formatDate value="${indexCfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${indexCfg.auditorName }</td>
<td><fmt:formatDate value="${indexCfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page" style="margin-top:40px">${page}</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -3,445 +3,303 @@
<html>
<head>
<title><spring:message code="${cfgName}"></spring:message></title>
<!-- BEGIN THEME GLOBAL STYLES -->
<style type="text/css">
.boxSolid{
border:1px solid #eeeeee
.boxSolid {
border: 1px solid #eeeeee
}
</style>
<script type="text/javascript">
$(function(){
$("#cancel").on("click",function(){
window.history.back();
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
$("#cfgFrom").validate({
errorPlacement: function(error,element){
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
},
submitHandler: function(form){
//代表所有业务都隐藏了,提示必须增加一种业务数据
if($(".boxSolid").length ==$(".boxSolid.hidden").length){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return;
}
loading('onloading...');
form.submit();
},
errorContainer: "#messageBox",
});
$(".action").on("change",function(){
$("#serviceId").val($(this).attr("serviceId"));
});
$(".disabled").each(function(){
$(this).find("input,select,div,button").each(function(){
$(this).attr("disabled","true");
});
});
//新增 默认不展示配置信息
if($("input[name=cfgId]").val() == ''){
$(".glyphicon-remove").click();
$(document)
.ready(
function() {
$("#cancel").on("click", function() {
window.history.back();
});
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
$("#protocolId").val($(this).attr("protocolId"));
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#protocolId").val($(".action:checked").attr("protocolId"));
$("#cfgFrom").validate(
{ errorPlacement : function(error, element) {
if($(element).parents().hasClass("tagsinput")){
$(element).parents(".col-md-6").next("div").append(error);
}else{
$(element).parents(".form-group").find(
"div[for='"
+ element.attr("name")
+ "']").append(error);
}
},
submitHandler : function(form) {
var flag = true;
//代表所有业务都隐藏了,提示必须增加一种业务数据
if($(".boxSolid").length ==$(".boxSolid.hidden").length){
top.$.jBox.tip("<spring:message code='one_more'/>", "<spring:message code='info'/>");
return;
}
//代表所有区域都隐藏了,提示必须增加个区域信息
if($("input[name='isAreaEffective']:checked").val()==1 && $(".container-fluid:visible").size()==0){
if($("#areaIsp").hasClass("hidden")) $("#areaIp").find(".glyphicon-plus").click();
if($("#areaIp").hasClass("hidden")) $("#areaIsp").find(".glyphicon-plus").click();
top.$.jBox.tip("<spring:message code='one_more_area'/>", "<spring:message code='info'/>");
return;
}
$(".boxSolid:visible").find("input[name$='cfgKeywords']").each(function(){
if($(this).val()==''){
$(this).parents(".form-group").find(
"div[for='"
+ $(this).attr("name")
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$("#keywordError").text()+"</label>");
flag = false;
}
})
//keywords非空校验完成校验二进制字符串
$(".boxSolid:visible").find("select[name$='isHexbin']").each(function(){
var isHexbin=$(this).val();
if(isHexbin == 1){ //十六进制
var keywords=$("input[name$='"+$(this).attr("name").replace("isHexbin","cfgKeywords")+"']").val();
if(keywords != ''){
if(!(/^([0-9|a-f|A-F]*)$/.test(keywords))){
$(this).parents(".boxSolid").find(
"div[for='"
+ $(this).attr("name").replace("isHexbin","cfgKeywords")
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$.validator.messages.hexCheck+"</label>");
flag = false;
}
}
}
});
var flag1=validateInvisibleCharTag();
if(flag){
flag=flag1;
}
if(flag){
//将disable属性的元素删除
$(".disabled").each(function(){
$(this).remove();
});
$("input[name$='exprType']").attr("disabled",false);
loading('onloading...');
form.submit();
}else{
return;
}
},
errorContainer : "#messageBox",
});
//业务内容增加
/* $("span[title='add']").on("click", function() {
$(".ipPort0").removeClass("hidden");
}); */
});
//业务窗口打开
var addContent = function(obj, contentClassName) {
var showDiv = $(obj).parent().parent().next();
$(showDiv).removeClass("hidden").removeClass(
"disabled");
/* $("."+contentClassName+"0").find("input,select").each(function(){
$(this).removeAttr("disabled");
}); */
$(obj).addClass("hidden");
}
});
//业务窗口打开
var addContent=function(obj,contentClassName){
$("."+contentClassName+"0").removeClass("hidden").removeClass("disabled");
$("."+contentClassName+"0").find("input,select").each(function(){
$(this).removeAttr("disabled");
});
$("."+contentClassName+"0").find(".disabled").each(function(){
$(this).removeClass("disabled");
});
$(obj).addClass("hidden");
}
//业务窗口关闭
var delContent=function(contentClassName,addBtnClassName){
$("."+contentClassName).addClass("hidden");
$("."+contentClassName).find("input,select").each(function(){
$(this).attr("disabled","true");
});
$("."+addBtnClassName).removeClass("hidden");
}
//业务窗口关闭
var delContent = function(contentClassName, addBtnClassName) {
$("." + contentClassName).addClass("hidden").addClass("disabled");
/* $("."+contentClassName).find("input,select").each(function(){
$(this).attr("disabled","true");
}); */
$("." + addBtnClassName).removeClass("hidden");
}
</script>
</head>
<body>
<div class="page-content">
<h3 class="page-title">
<spring:message code="av_voip_control"></spring:message>
</h3>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-gift"></i>
<c:if test="${empty _cfg.cfgId}"><spring:message code="add"></spring:message></c:if>
<c:if test="${not empty _cfg.cfgId}"><spring:message code="edit"></spring:message></c:if>
<span id="keywordError" style="display:none"><spring:message code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message code="multiple_keywords_tip"></spring:message></span>
<div class="page-content">
<h3 class="page-title">
<spring:message code="av_voip_ip_control"></spring:message>
</h3>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-gift"></i>
<c:if test="${empty _cfg.cfgId}">
<spring:message code="add"></spring:message>
</c:if>
<c:if test="${not empty _cfg.cfgId}">
<spring:message code="edit"></spring:message>
</c:if>
</div>
</div>
</div>
<div class="portlet-body form">
<!-- BEGIN FORM-->
<form id="cfgFrom" action="${ctx}/ntc/av/saveVoip" method="post" class="form-horizontal">
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="serviceId" name="serviceId" value="${_cfg.serviceId}">
<c:set var="voipIpCfgId" value=""/>
<c:forEach items="${_cfg.voipIps}" var="voipIp" varStatus="status">
<c:if test="${not empty voipIp.cfgId}">
<c:set var="voipIpCfgId" value="${voipIpCfgId},${voipIp.cfgId}"/>
</c:if>
</c:forEach>
<input type="hidden" name="voipIpIds" value="${voipIpCfgId}">
<c:set var="voipAccountCfgId" value=""/>
<c:forEach items="${_cfg.voipAccounts}" var="voipAccount" varStatus="status">
<c:if test="${not empty voipAccount.cfgId}">
<c:set var="voipAccountCfgId" value="${voipAccountCfgId},${voipAccount.cfgId}"/>
</c:if>
</c:forEach>
<input type="hidden" name="voipAccountIds" value="${voipAccountCfgId}">
<div class="form-body">
<!-- desc and action -->
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="config_describe"/></label>
<div class="col-md-6">
<input class="form-control" type="text" name="cfgDesc" value="${_cfg.cfgDesc}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message code="action"/></label>
<div class="col-md-6">
<c:forEach items="${serviceList}" var="service"
varStatus="satus">
<label class="radio-inline"> <c:if
test="${_cfg.functionId eq service.functionId}">
<input type="radio" name="action"
serviceId="${service.serviceId }"
protocolId="${service.protocolId }"
value="${service.action }" class="required action"
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq service.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</c:if>
</label>
</c:forEach>
</div>
<div for="action"></div>
</div>
</div>
<div class="portlet-body form">
<!-- BEGIN FORM-->
<form id="cfgFrom" action="${ctx}/ntc/av/saveVoip"
method="post" class="form-horizontal">
<input type="hidden" name="cfgId" value="${_cfg.cfgId}">
<input type="hidden" name="compileId" value="${_cfg.compileId}">
<input type="hidden" name="functionId" value="${_cfg.functionId}">
<input type="hidden" id="serviceId" name="serviceId"
value="${_cfg.serviceId}">
<div class="form-body">
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message
code="config_describe" /></label>
<div class="col-md-6">
<input class="form-control" type="text" name="cfgDesc"
value="${_cfg.cfgDesc}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><spring:message
code="action" /></label>
<div class="col-md-6">
<c:forEach items="${serviceList}" var="service"
varStatus="satus">
<label class="radio-inline"> <c:if
test="${_cfg.functionId eq service.functionId}">
<input type="radio" name="action"
serviceId="${service.serviceId }"
protocolId="${service.protocolId }"
value="${service.action }" class="required action"
<c:if test="${_cfg.action==service.action || (_cfg.action==null && satus.index==0)}">checked</c:if>>
<c:forEach items="${fns:getDictList('SERVICE_ACTION') }" var="dict">
<c:if test="${dict.itemCode eq service.action }">
<spring:message code="${dict.itemValue }"/>
</c:if>
</c:forEach>
</c:if>
</label>
</c:forEach>
</div>
<div for="action"></div>
</div>
</div>
</div>
<!-- desc and action -->
<!-- 动态展示各个域信息start -->
<c:forEach items="${regionList}" var="region">
<!-- 字符串类域配置 -->
<c:if test="${region.regionType==2 }">
<!--account info-->
<h4 class="form-section"> <spring:message code="av_voip_account_title"/><small> <span class="glyphicon glyphicon-plus voipAccountAdd" onClick="addContent(this,'voipAccount')" title="add"></span></small></h4>
<c:forEach items="${_cfg.voipAccounts}" var="voipAccount" varStatus="status">
<c:choose>
<c:when test="${not empty _cfg.cfgId}">
<c:choose>
<c:when test="${empty voipAccount.cfgId}">
<div class="row boxSolid hidden disabled voipAccount${status.index }">
</c:when>
<c:otherwise>
<div class="row boxSolid voipAccount${status.index }">
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<div class="row boxSolid voipAccount${status.index }">
</c:otherwise>
</c:choose>
<input type="hidden" name="voipAccounts[${status.index }].cfgId" value="${voipAccount.cfgId}">
<input type="hidden" name="voipAccounts[${status.index }].cfgType" value="${region.configRegionValue}">
<input type="hidden" name="voipAccounts[${status.index }].cfgRegionCode" value="${region.configRegionCode}">
<div class="row">
<div class="pull-right">
<span class="glyphicon glyphicon-remove pull-right" title="remove" onClick="delContent('voipAccount${status.index }','voipAccountAdd');"/>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="account"/></label>
<div class="col-md-6">
<input class="form-control required" type="text" name="voipAccounts[${status.index }].cfgKeywords" value="${voipAccount.cfgKeywords}">
</div>
<div for="voipAccounts[${status.index }].cfgKeywords"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="whether_hexbinary"/></label>
<div class="col-md-6">
<select name="voipAccounts[${status.index }].isHexbin" class="selectpicker select2 form-control required">
<c:forEach items="${fns:getDictList('WHETHER_HEXBINARY')}" var="isHexbinC">
<option value="${isHexbinC.itemCode}" <c:if test="${voipAccount.isHexbin==isHexbinC.itemCode || (voipAccount.isHexbin==null && isHexbinC.itemCode==0)}">selected</c:if>><spring:message code="${isHexbinC.itemValue}"/></option>
</c:forEach>
</select>
</div>
<div for="voipAccounts[${status.index }].isHexbin"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="expression_type"/></label>
<div class="col-md-6">
<label class="radio-inline hidden">
<input type="radio" name="voipAccounts[${status.index }].exprType" value="1"
<c:if test="${voipAccount.exprType==1}">checked</c:if>
><spring:message code="and_expression"/>
</label>
<label class="radio-inline">
<input type="radio" name="voipAccounts[${status.index }].exprType" value="0" class="required"
<c:if test="${voipAccount.exprType==0 || voipAccount.exprType==null}">checked</c:if>
><spring:message code="null_expression"/>
</label>
</div>
<div for="voipAccounts[${status.index }].exprType"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="match_method"/></label>
<div class="col-md-6">
<select name="voipAccounts[${status.index }].matchMethod" class="selectpicker select2 form-control required" >
<c:forEach items="${fns:getDictList('MATCH_METHOD')}" var="matchMethodC">
<option value="${matchMethodC.itemCode}" <c:if test="${voipAccount.matchMethod==matchMethodC.itemCode || (voipAccount.matchMethod==null && matchMethodC.itemCode==1)}">selected</c:if>><spring:message code="${matchMethodC.itemValue}"/></option>
</c:forEach>
</select>
</div>
<div for="voipAccounts[${status.index }].matchMethod"></div>
</div>
</div>
</div>
</div>
</c:forEach>
<!--account info-->
</c:if>
<!-- ip类域配置 -->
<c:if test="${region.regionType==1 }">
<!--/ip info-->
<h4 class="form-section"> <spring:message code="av_voip_ip_title"/><small>
<span class="glyphicon glyphicon-plus voipIpAdd" onClick="addContent(this,'voipIp')" title="add"></span>
</small>
</h4>
<c:forEach items="${_cfg.voipIps}" var="voipIp" varStatus="status">
<c:choose>
<c:when test="${not empty _cfg.cfgId}">
<c:choose>
<c:when test="${empty voipIp.cfgId}">
<div class="row boxSolid hidden disabled voipIp${status.index }">
</c:when>
<c:otherwise>
<div class="row boxSolid voipIp${status.index }">
<c:set var="ipCfgIndex" value="0"></c:set>
<c:set var="strCfgIndex" value="0"></c:set>
<c:forEach items="${regionList}" var="region" varStatus="status">
<c:if test="${region.regionType eq 1 }">
<!--ip info-->
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section">
<spring:message code="${region.configRegionValue}" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:set var="cfgName" value="voipIps[${ipCfgIndex}]"></c:set>
<%-- <c:set var="regionValue" value="${region.configRegionValue}"></c:set> --%>
<c:choose>
<c:when test="${fn:length(_cfg.voipIps)>0 and ipCfgIndex<fn:length(_cfg.voipIps) }">
<c:forEach items="${_cfg.voipIps}" var="ipPort">
<c:if test="${region.configRegionValue eq ipPort.cfgType }">
<div class="row boxSolid ${tabName}${status.index}">
<%@include file="/WEB-INF/views/cfg/ipCfgForm.jsp"%>
</div>
<c:set var="ipCfgIndex" value="${ipCfgIndex+1}"></c:set>
</c:if>
</c:forEach>
</c:when>
<c:otherwise>
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/ipCfgForm.jsp"%>
</div>
<c:set var="ipCfgIndex" value="${ipCfgIndex+1 }"></c:set>
</c:otherwise>
</c:choose>
</c:when>
<c:otherwise>
<div class="row boxSolid voipIp${status.index }">
</c:otherwise>
</c:choose>
<input type="hidden" name="voipIps[${status.index }].protocolId" value="" id="protocolId">
<input type="hidden" name="voipIps[${status.index }].cfgId" value="${voipIp.cfgId}">
<input type="hidden" name="voipIps[${status.index }].cfgType" value="${region.configRegionValue}">
<input type="hidden" name="voipIps[${status.index }].cfgRegionCode" value="${region.configRegionCode}">
<div class="row">
<div class="pull-right">
<span class="glyphicon glyphicon-remove pull-right" title="remove" onClick="delContent('voipIp${status.index }','voipIpAdd');"/>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_type"/></label>
<div class="col-md-6">
<select name="voipIps[${status.index }].ipType" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('IP_TYPE')}" var="ipType" varStatus="satus">
<option value="${ipType.itemCode}" <c:if test="${voipIp.ipType==ipType.itemCode || (voipIp.ipType==null && ipType.itemCode==4)}">selected</c:if> ><spring:message code="${ipType.itemValue}"/></option>
</c:forEach>
</select>
</div>
<div for="voipIps[${status.index }].ipType"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="ip_pattern"/></label>
<div class="col-md-6">
<select name="voipIps[${status.index }].ipPattern" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('IP_PATTERN')}" var="ipPatternC" varStatus="satus">
<option value="${ipPatternC.itemCode}" <c:if test="${voipIp.ipPattern==ipPatternC.itemCode || (voipIp.ipPattern==null && ipPatternC.itemCode==3)}">selected</c:if> ><spring:message code="${ipPatternC.itemValue}"/></option>
</c:forEach>
</select>
</div>
<div for="voipIps[${status.index }].ipPattern"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_ip"/></label>
<div class="col-md-6">
<input class="form-control required ipCheck" type="text" name="voipIps[${status.index }].srcIpAddress" value="${voipIp.srcIpAddress}">
</div>
<div for="voipIps[${status.index }].srcIpAddress"></div>
</div>
</div>
</div>
<c:choose>
<c:when test="${voipIp.cfgId==null}">
<div class="row hidden port">
</c:when>
<c:otherwise>
<div class="row port">
</c:otherwise>
</c:choose>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="port_pattern"/></label>
<div class="col-md-6">
<select name="voipIps[${status.index }].portPattern" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('PORT_PATTERN')}" var="portPatternC" varStatus="satus">
<option value="${portPatternC.itemCode}" <c:if test="${voipIp.portPattern==portPatternC.itemCode || (voipIp.portPattern==null && portPatternC.itemCode==1)}">selected</c:if> ><spring:message code="${portPatternC.itemValue}"/></option>
</c:forEach>
</select>
</div>
<div for="voipIps[${status.index }].portPattern"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="client_port"/></label>
<div class="col-md-6">
<input class="form-control required portCheck" type="text" name="voipIps[${status.index }].srcPort" value="${voipIp.srcPort}">
</div>
<div for="voipIps[${status.index }].srcPort"></div>
</div>
</div>
</div>
<c:choose>
<c:when test="${voipIp.cfgId==null}">
<div class="row hidden destPort">
</c:when>
<c:otherwise>
<div class="row destPort">
</c:otherwise>
</c:choose>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_ip"/></label>
<div class="col-md-6">
<input class="form-control required ipCheck" type="text" name="voipIps[${status.index }].destIpAddress" value="${voipIp.destIpAddress}">
</div>
<div for="voipIps[${status.index }].destIpAddress"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="server_port"/></label>
<div class="col-md-6">
<input class="form-control required portCheck" type="text" name="voipIps[${status.index }].destPort" value="${voipIp.destPort}">
</div>
<div for="voipIps[${status.index }].destPort"></div>
</div>
</div>
</div>
<c:choose>
<c:when test="${voipIp.cfgId==null}">
<div class="row hidden protocol">
</c:when>
<c:otherwise>
<div class="row protocol">
</c:otherwise>
</c:choose>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="protocol"/></label>
<div class="col-md-6">
<select name="voipIps[${status.index }].protocol" class="selectpicker show-tick form-control required">
<c:forEach items="${fns:getDictList('PROTOCOL')}" var="protocolC" varStatus="satus">
<option value="${protocolC.itemCode}" <c:if test="${voipIp.protocol==protocolC.itemCode || (voipIp.protocol==null && protocolC.itemCode==0)}">selected</c:if> ><spring:message code="${protocolC.itemValue}"/></option>
</c:forEach>
</select>
</div>
<div for="voipIps[${status.index }].protocol"></div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="direction"/></label>
<div class="col-md-6">
<select name="voipIps[${status.index }].direction" class="selectpicker show-tick form-control required" >
<c:forEach items="${fns:getDictList('DIRECTION')}" var="directionC" varStatus="satus">
<option value="${directionC.itemCode}" <c:if test="${voipIp.direction==directionC.itemCode || (voipIp.direction==null && directionC.itemCode==0)}">selected</c:if> ><spring:message code="${directionC.itemValue}"/></option>
</c:forEach>
</select>
</div>
<div for="voipIps[${status.index }].direction"></div>
</div>
</div>
</div>
<c:if test="${voipIp.cfgId==null}">
<div class="row">
<button type="button" class="btn btn-red-hollow center-block" onClick="more(this);" data-click-times="0"><spring:message code="show_more"/></button>
</div>
</c:if>
<br>
</div>
</c:forEach>
</c:choose>
<!--/ip info-->
</c:if>
</c:forEach>
<!-- 动态展示各个域信息end -->
<br>
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %>
<br>
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
<button id="save" type="submit" class="btn green"><spring:message code="submit"/></button>
<button id="cancel" type="button" class="btn default"><spring:message code="cancel"/></button>
</div>
</div>
</div>
<div class="col-md-6"> </div>
</div>
</div>
</form>
<!-- END FORM-->
</div>
</div>
</c:if>
<c:if test="${region.regionType eq 2 }">
<c:set var="tabName" value="${region.configRegionValue}Tab"></c:set>
<h4 class="form-section">
<spring:message code="${region.configRegionValue}" />
<small> <span
class="glyphicon glyphicon-plus ${tabName}Add"
onClick="addContent(this,'${tabName}')" title="add"></span></small>
</h4>
<c:set var="cfgName" value="ntcSubscribeIdCfgList[${strCfgIndex}]"></c:set>
<%-- <c:set var="regionValue" value="${region.configRegionValue}"></c:set> --%>
<c:choose>
<c:when test="${fn:length(_cfg.ntcSubscribeIdCfgList)>0}">
<c:set var="isBreak" value="false" ></c:set>
<c:forEach items="${_cfg.ntcSubscribeIdCfgList}" var="cfg">
<c:choose>
<c:when test="${region.configRegionValue eq cfg.cfgType and !isBreak}">
<div class="row boxSolid ${tabName}${status.index}">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="isBreak" value="true" ></c:set>
<c:set var="strCfgIndex" value="${strCfgIndex+1 }"></c:set>
</c:when>
</c:choose>
</c:forEach>
<c:if test="${!isBreak}">
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="strCfgIndex" value="${strCfgIndex+1 }"></c:set>
</c:if>
</c:when>
<c:otherwise>
<div class="row boxSolid ${tabName}${status.index} hidden disabled">
<%@include file="/WEB-INF/views/cfg/complexCfgForm.jsp"%>
</div>
<c:set var="strCfgIndex" value="${strCfgIndex+1 }"></c:set>
</c:otherwise>
</c:choose>
</c:if>
</c:forEach>
<br>
<%@include file="/WEB-INF/include/form/areaInfo.jsp"%>
<br>
<%@include file="/WEB-INF/include/form/basicInfo.jsp"%>
<div class="form-actions">
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
<button id="save" type="submit" class="btn green">
<spring:message code="submit" />
</button>
<button id="cancel" type="button" class="btn default">
<spring:message code="cancel" />
</button>
</div>
</div>
</div>
<div class="col-md-6"></div>
</div>
</div>
</div>
</form>
<!-- END FORM-->
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -29,8 +29,8 @@
$("#intype").val("${cfg.voipIp.srcIpAddress}");
}else if("${cfg.voipIp.srcPort}"){
$("#intype").val("${cfg.voipIp.srcPort}");
}else if("${cfg.voipAccount.cfgKeywords}"){
$("#intype").val("${cfg.voipAccount.cfgKeywords}");
}else if("${cfg.ntcSubscribeIdCfg.cfgKeywords}"){
$("#intype").val("${cfg.ntcSubscribeIdCfg.cfgKeywords}");
}else{
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
}
@@ -52,6 +52,7 @@
$(".Wdate").attr("value",'');
$("#level").attr("value",'');
$("#searchForm")[0].reset();
$("#intype").attr("placeholder","<spring:message code='input'/> "+$("#seltype").find("option:selected").text());
});
//异步获取voip相关信息
@@ -64,14 +65,14 @@
var compileId=$(this).attr("compileId");
var cfgId=$(this).attr("cfgId");
var hasIp=false;
var hasAccount=false;
var hasSubscribe=false;
if($("#"+openId).parent().parent().next("tr").hasClass("child")){
$("#"+openId).parent().parent().next("tr").show();
}else{
$.ajax({
type:'post',
async:false,
url:'${ctx}/ntc/av/ajaxVoipAndAccountInfo',
url:'${ctx}/ntc/av/ajaxVoipIpInfo',
data:{"compileId":compileId,"cfgId":cfgId},
success:function(data){
var voipIpCfgTab="<tr class='child'>"+
@@ -81,17 +82,17 @@
"<td colspan='"+($(".table tr").eq(0).children("th").length-1)+"'>";
var html="";
html+="<div class='row'>";
if(data.account.length >0){
hasAccount=true;
html+="<div id='accountTitle"+index+"' onclick='switchInfo(\"ip\","+index+")' class='col-md-1 tabInfo badge-info' >";
html+="<spring:message code='av_voip_account_title'/>";
html+="<i id='accountDown"+index+"' class='fa fa-angle-double-down '></i>";
html+="<i id='accountUp"+index+"' class='fa fa-angle-double-up ' style='display:none'></i>";
if(data.subscribe.length >0){
hasSubscribe=true;
html+="<div id='subscribeTitle"+index+"' onclick='switchInfo(\"ip\","+index+")' class='col-md-1 tabInfo badge-info' >";
html+="<spring:message code='NTC_SUBSCRIBE_ID'/>";
html+="<i id='subscribeDown"+index+"' class='fa fa-angle-double-down '></i>";
html+="<i id='subscribeUp"+index+"' class='fa fa-angle-double-up ' style='display:none'></i>";
html+="</div>";
}
if(data.ip.length >0){
hasIp=true;
html+="<div id='ipTitle"+index+"' onclick='switchInfo(\"account\","+index+")' class='col-md-1 tabInfo' >";
html+="<div id='ipTitle"+index+"' onclick='switchInfo(\"subscribe\","+index+")' class='col-md-1 tabInfo' >";
html+="<spring:message code='av_voip_ip_title'/>";
html+="<i id='ipDown"+index+"' class='fa fa-angle-double-down' style='display:none' ></i>";
html+="<i id='ipUp"+index+"' class='fa fa-angle-double-up '></i>";
@@ -99,16 +100,16 @@
}
html+="</div>";
//account信息
if(data.account.length > 0){
html+="<div id='accountInfo"+index+"' class='content'>";
$.each(data.account,function(index,item){
//subscribe信息
if(data.subscribe.length > 0){
html+="<div id='subscribeInfo"+index+"' class='content'>";
$.each(data.subscribe,function(index,item){
html+="<div class='row'>";
html+="<div class='col-md-4'>";
html+="<div class='form-group'>";
html+="<label><spring:message code='account'/></label>";
html+="<label><spring:message code='NTC_SUBSCRIBE_ID'/></label>";
html+="<label>"
html+=item.cfgKeywords.replace("***and***", " ");
html+=item.cfgKeywords.replace(/\*\*\*and\*\*\*/g , " ");
html+="</label>";
html+="</div>";
html+="</div>";
@@ -324,11 +325,11 @@
voipIpCfgTab+="</td>";
voipIpCfgTab+="</tr>";
$("#"+openId).parent().parent().after(voipIpCfgTab);
if(hasAccount && ! hasIp){
if(hasSubscribe && ! hasIp){
switchInfo("ip",index);
}
if(hasIp && ! hasAccount){
switchInfo("account",index);
if(hasIp && ! hasSubscribe){
switchInfo("subscribe",index);
}
}
});
@@ -345,55 +346,27 @@
});
});
/* function edit() {
var checkboxes = $(".child-checks:checked");
if (checkboxes.length == 0) {
alertx("<spring:message code='one_more'/>");
} else if (checkboxes.length > 1) {
alertx("<spring:message code='check_one'/>");
} else {
window.location.href = "${ctx}/cfg/dnsIp/form?cfgId=" + checkboxes.attr("id");
}
}
function delCfg() {
var checkboxes = $(".child-checks:checked");
if (checkboxes.length == 0) {
alertx("<spring:message code='one_more'/>");
} else {
var ids = "";
checkboxes.each(function(){
ids = ids + $(this).attr("id") + ",";
});
console.log(ids);
if (confirm("<spring:message code='confirm_message'/>")) {
$("#fakeIds").val(ids);
$("#searchForm").attr("action","${ctx}/cfg/dnsIp/delete");
$("#searchForm").submit();
}
}
} */
function switchInfo(flag,index){
//关闭ip信息
//关闭ip信息
if("ip" ==flag){
$("#ipInfo"+index).hide();
$("#downIp"+index).hide();
$("#ipTitle"+index).removeClass("badge-info");
$("#accountInfo"+index).show();
$("#accountDown"+index).show();
$("#accountUp"+index).hide();
$("#subscribeInfo"+index).show();
$("#subscribeDown"+index).show();
$("#subscribeUp"+index).hide();
$("#ipUp"+index).show();
$("#ipDown"+index).hide();
$("#accountTitle"+index).addClass("badge-info");
$("#subscribeTitle"+index).addClass("badge-info");
}else{
//关闭account信息
$("#accountInfo"+index).hide();
$("#downAccount"+index).hide();
$("#accountTitle"+index).removeClass("badge-info");
//关闭subscribe信息
$("#subscribeInfo"+index).hide();
$("#downsubscribe"+index).hide();
$("#subscribeTitle"+index).removeClass("badge-info");
$("#ipInfo"+index).show();
$("#ipDown"+index).show();
$("#accountUp"+index).show();
$("#accountDown"+index).hide();
$("#subscribeUp"+index).show();
$("#subscribeDown"+index).hide();
$("#ipUp"+index).hide();
$("#ipTitle"+index).addClass("badge-info");
}
@@ -416,7 +389,7 @@
</div>
<h3 class="page-title">
<spring:message code="av_voip_control"/>
<spring:message code="av_voip_ip_control"/>
<small><spring:message code="date_list"/></small>
</h3>
<h5 class="page-header"></h5>
@@ -455,7 +428,7 @@
<form:option value="cfgDesc"><spring:message code="config_describe"></spring:message></form:option>
<form:option value="voipIp.srcIpAddress"><spring:message code="client_ip"/></form:option>
<form:option value="voipIp.srcPort"><spring:message code="client_port"/></form:option>
<form:option value="voipAccount."><spring:message code="account"/></form:option>
<form:option value="ntcSubscribeIdCfg.cfgKeywords"><spring:message code="NTC_SUBSCRIBE_ID"/></form:option>
</form:select>
</div>