Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop
This commit is contained in:
@@ -27,7 +27,6 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
|||||||
private static final String tableName="cfg_index_info";
|
private static final String tableName="cfg_index_info";
|
||||||
private List<AvVoipAccountCfg> voipAccounts;//Add表单使用
|
private List<AvVoipAccountCfg> voipAccounts;//Add表单使用
|
||||||
private List<AvVoipIpCfg> voipIps; //Add表单使用
|
private List<AvVoipIpCfg> voipIps; //Add表单使用
|
||||||
private AreaIpCfg areaIpCfg;
|
|
||||||
private AvVoipAccountCfg voipAccount;//Search使用
|
private AvVoipAccountCfg voipAccount;//Search使用
|
||||||
private AvVoipIpCfg voipIp;//Search使用
|
private AvVoipIpCfg voipIp;//Search使用
|
||||||
private IpPortCfg ipPort;
|
private IpPortCfg ipPort;
|
||||||
@@ -143,11 +142,5 @@ public class CfgIndexInfo extends BaseCfg<CfgIndexInfo> {
|
|||||||
public static String getTablename() {
|
public static String getTablename() {
|
||||||
return tableName;
|
return tableName;
|
||||||
}
|
}
|
||||||
public AreaIpCfg getAreaIpCfg() {
|
|
||||||
return areaIpCfg;
|
|
||||||
}
|
|
||||||
public void setAreaIpCfg(AreaIpCfg areaIpCfg) {
|
|
||||||
this.areaIpCfg = areaIpCfg;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,9 +141,12 @@ public class AvContentController extends BaseController {
|
|||||||
@RequestMapping(value = {"/contentIpForm"})
|
@RequestMapping(value = {"/contentIpForm"})
|
||||||
public String contIpForm(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")AvContIpCfg cfg){
|
public String contIpForm(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")AvContIpCfg cfg){
|
||||||
if(!StringUtil.isEmpty(ids)){
|
if(!StringUtil.isEmpty(ids)){
|
||||||
|
cfg.setCfgId(Long.parseLong(ids));
|
||||||
cfg = avContentCfgService.getContIpCfgById(cfg);
|
cfg = avContentCfgService.getContIpCfgById(cfg);
|
||||||
|
initUpdateFormCondition(model, cfg);
|
||||||
|
}else{
|
||||||
|
initFormCondition(model,cfg);
|
||||||
}
|
}
|
||||||
initFormCondition(model,cfg);
|
|
||||||
model.addAttribute("_cfg", cfg);
|
model.addAttribute("_cfg", cfg);
|
||||||
return "/cfg/av/contIp/contIpForm";
|
return "/cfg/av/contIp/contIpForm";
|
||||||
}
|
}
|
||||||
@@ -151,9 +154,10 @@ public class AvContentController extends BaseController {
|
|||||||
//保存voip信息
|
//保存voip信息
|
||||||
@RequestMapping(value = {"/saveContIp"})
|
@RequestMapping(value = {"/saveContIp"})
|
||||||
public String saveContIp(Model model,HttpServletRequest request,HttpServletResponse response,
|
public String saveContIp(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||||
@ModelAttribute("cfg")AvContIpCfg cfg){
|
@ModelAttribute("cfg")AvContIpCfg cfg,
|
||||||
|
@ModelAttribute("areaCfgIds")String areaCfgIds){
|
||||||
try{
|
try{
|
||||||
avContentCfgService.saveOrUpdateAvContIp(cfg);
|
avContentCfgService.saveOrUpdateAvContIp(cfg,areaCfgIds);
|
||||||
addMessage(model,"save_success");
|
addMessage(model,"save_success");
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.error("信息保存失败",e);
|
logger.error("信息保存失败",e);
|
||||||
|
|||||||
@@ -17,10 +17,9 @@ import com.nis.web.dao.MyBatisDao;
|
|||||||
@MyBatisDao
|
@MyBatisDao
|
||||||
public interface AreaIpCfgDao extends CrudDao<AreaIpCfg>{
|
public interface AreaIpCfgDao extends CrudDao<AreaIpCfg>{
|
||||||
public List<AreaIpCfg> getByCompileId(@Param("compileId") int compileId) ;
|
public List<AreaIpCfg> getByCompileId(@Param("compileId") int compileId) ;
|
||||||
public List<AreaIpCfg> findAreaIpCfgList(CfgIndexInfo entity);
|
|
||||||
public void saveAreaIpCfg(AreaIpCfg entity);
|
public void saveAreaIpCfg(AreaIpCfg entity);
|
||||||
public void saveAreaIpCfgFromCfgIndexInfo(CfgIndexInfo entity);
|
public void updateAreaIpCfg(AreaIpCfg entity);
|
||||||
public void updateAreaIpCfgFromCfgIndexInfo(CfgIndexInfo entity);
|
public void updateAreaIpCfgValid(AreaIpCfg entity);
|
||||||
public void deleteAreaIpCfg(AreaIpCfg entity);
|
public void deleteAreaIpCfg(AreaIpCfg entity);
|
||||||
public void deleteAreaIpCfgByCfgId(CfgIndexInfo entity);
|
public void deleteAreaIpCfgByCfgId(AreaIpCfg entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,26 +52,6 @@
|
|||||||
</if>
|
</if>
|
||||||
AND IS_VALID!=-1
|
AND IS_VALID!=-1
|
||||||
</trim>
|
</trim>
|
||||||
</select>
|
|
||||||
<!-- 根据compileId获取avVoipAccountCfg信息 -->
|
|
||||||
<select id="findAreaIpCfgList" resultMap="BaseIpMap" parameterType="com.nis.domain.configuration.CfgIndexInfo">
|
|
||||||
select
|
|
||||||
<include refid="AreaIpCfg_Column_List_with_id" />
|
|
||||||
from area_ip_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>
|
</select>
|
||||||
<!-- insert area_ip_cfg表信息 -->
|
<!-- insert area_ip_cfg表信息 -->
|
||||||
<insert id="saveAreaIpCfg" parameterType="com.nis.domain.configuration.AreaIpCfg" >
|
<insert id="saveAreaIpCfg" parameterType="com.nis.domain.configuration.AreaIpCfg" >
|
||||||
@@ -141,76 +121,9 @@
|
|||||||
#{cfgRegionCode,jdbcType=INTEGER}
|
#{cfgRegionCode,jdbcType=INTEGER}
|
||||||
)
|
)
|
||||||
</insert>
|
</insert>
|
||||||
<!-- insert area_ip_cfg表信息 -->
|
|
||||||
<insert id="saveAreaIpCfgFromCfgIndexInfo" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
|
||||||
insert into area_ip_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,
|
|
||||||
ip_type,
|
|
||||||
src_ip_address,
|
|
||||||
ip_pattern,
|
|
||||||
port_pattern,
|
|
||||||
src_port,
|
|
||||||
protocol,
|
|
||||||
protocol_id,
|
|
||||||
direction,
|
|
||||||
dest_port,
|
|
||||||
dest_ip_address,
|
|
||||||
cfg_type,
|
|
||||||
cfg_region_code
|
|
||||||
)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},
|
|
||||||
#{areaIpCfg.ipType,jdbcType=INTEGER},
|
|
||||||
#{areaIpCfg.srcIpAddress,jdbcType=VARCHAR},
|
|
||||||
#{areaIpCfg.ipPattern,jdbcType=INTEGER},
|
|
||||||
#{areaIpCfg.portPattern,jdbcType=INTEGER},
|
|
||||||
#{areaIpCfg.srcPort,jdbcType=VARCHAR},
|
|
||||||
#{areaIpCfg.protocol,jdbcType=INTEGER},
|
|
||||||
#{areaIpCfg.protocolId,jdbcType=INTEGER},
|
|
||||||
#{areaIpCfg.direction,jdbcType=INTEGER},
|
|
||||||
#{areaIpCfg.destPort,jdbcType=VARCHAR},
|
|
||||||
#{areaIpCfg.destIpAddress,jdbcType=VARCHAR},
|
|
||||||
#{areaIpCfg.cfgType,jdbcType=VARCHAR},
|
|
||||||
#{areaIpCfg.cfgRegionCode,jdbcType=INTEGER}
|
|
||||||
)
|
|
||||||
</insert>
|
|
||||||
<!-- update av_voip_ip_cfg表信息 -->
|
<!-- update av_voip_ip_cfg表信息 -->
|
||||||
<update id="updateAreaIpCfgFromCfgIndexInfo" parameterType="com.nis.domain.configuration.CfgIndexInfo" >
|
<update id="updateAreaIpCfg" parameterType="com.nis.domain.configuration.AreaIpCfg" >
|
||||||
update area_ip_cfg
|
update area_ip_cfg
|
||||||
<set >
|
<set >
|
||||||
<trim suffixOverrides=",">
|
<trim suffixOverrides=",">
|
||||||
@@ -265,47 +178,47 @@
|
|||||||
<if test="serviceId != null" >
|
<if test="serviceId != null" >
|
||||||
service_id = #{serviceId,jdbcType=INTEGER},
|
service_id = #{serviceId,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
<if test="areaIpCfg != null and areaIpCfg.ipType != null" >
|
<if test="ipType != null" >
|
||||||
ip_type = #{areaIpCfg.ipType,jdbcType=INTEGER},
|
ip_type = #{ipType,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
<if test="areaIpCfg != null and areaIpCfg.srcIpAddress != null and areaIpCfg.srcIpAddress != ''" >
|
<if test="srcIpAddress != null and srcIpAddress != ''" >
|
||||||
src_ip_address = #{areaIpCfg.srcIpAddress,jdbcType=VARCHAR},
|
src_ip_address = #{srcIpAddress,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="areaIpCfg != null and areaIpCfg.ipPattern != null" >
|
<if test="ipPattern != null" >
|
||||||
ip_pattern = #{areaIpCfg.ipPattern,jdbcType=INTEGER},
|
ip_pattern = #{ipPattern,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
<if test="areaIpCfg != null and areaIpCfg.portPattern != null" >
|
<if test="portPattern != null" >
|
||||||
port_pattern = #{areaIpCfg.portPattern,jdbcType=INTEGER},
|
port_pattern = #{portPattern,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
<if test="areaIpCfg != null and areaIpCfg.srcPort != null and areaIpCfg.srcPort != ''" >
|
<if test="srcPort != null and srcPort != ''" >
|
||||||
src_port = #{areaIpCfg.srcPort,jdbcType=VARCHAR},
|
src_port = #{srcPort,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="areaIpCfg != null and areaIpCfg.protocol != null" >
|
<if test="protocol != null" >
|
||||||
protocol = #{areaIpCfg.protocol,jdbcType=INTEGER},
|
protocol = #{protocol,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
<if test="areaIpCfg != null and areaIpCfg.protocolId != null" >
|
<if test="protocolId != null" >
|
||||||
protocol_id = #{areaIpCfg.protocolId,jdbcType=INTEGER},
|
protocol_id = #{protocolId,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
<if test="areaIpCfg != null and areaIpCfg.direction != null" >
|
<if test="direction != null" >
|
||||||
direction = #{areaIpCfg.direction,jdbcType=INTEGER},
|
direction = #{direction,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
<if test="areaIpCfg != null and areaIpCfg.destPort != null and areaIpCfg.destPort != ''" >
|
<if test="destPort != null and destPort != ''" >
|
||||||
dest_port = #{areaIpCfg.destPort,jdbcType=VARCHAR},
|
dest_port = #{destPort,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="areaIpCfg != null and areaIpCfg.destIpAddress != null and areaIpCfg.destIpAddress != ''" >
|
<if test="destIpAddress != null and destIpAddress != ''" >
|
||||||
dest_ip_address = #{areaIpCfg.destIpAddress,jdbcType=VARCHAR},
|
dest_ip_address = #{destIpAddress,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="areaIpCfg != null and areaIpCfg.cfgType != null and areaIpCfg.cfgType != ''" >
|
<if test="cfgType != null and cfgType != ''" >
|
||||||
cfg_type = #{areaIpCfg.cfgType,jdbcType=VARCHAR},
|
cfg_type = #{cfgType,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
<if test="areaIpCfg != null and areaIpCfg.cfgRegionCode != null " >
|
<if test="cfgRegionCode != null " >
|
||||||
cfg_region_code = #{areaIpCfg.cfgRegionCode,jdbcType=INTEGER},
|
cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER},
|
||||||
</if>
|
</if>
|
||||||
</trim>
|
</trim>
|
||||||
</set>
|
</set>
|
||||||
<where>
|
<where>
|
||||||
<if test="areaIpCfg != null and areaIpCfg.cfgId != null" >
|
<if test="cfgId != null" >
|
||||||
and cfg_id = #{areaIpCfg.cfgId,jdbcType=INTEGER}
|
and cfg_id = #{cfgId,jdbcType=INTEGER}
|
||||||
</if>
|
</if>
|
||||||
<if test="compileId != null" >
|
<if test="compileId != null" >
|
||||||
and compile_id = #{compileId,jdbcType=INTEGER}
|
and compile_id = #{compileId,jdbcType=INTEGER}
|
||||||
@@ -319,20 +232,23 @@
|
|||||||
<delete id="deleteAreaIpCfg" >
|
<delete id="deleteAreaIpCfg" >
|
||||||
delete from area_ip_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
delete from area_ip_cfg where compile_id=#{compileId} and function_id=#{functionId}
|
||||||
</delete>
|
</delete>
|
||||||
|
<update id="updateAreaIpCfgValid" parameterType="com.nis.domain.configuration.BaseCfg">
|
||||||
|
update area_ip_cfg set is_valid = #{isValid,jdbcType=INTEGER},
|
||||||
|
editor_id = #{editorId,jdbcType=INTEGER} ,
|
||||||
|
edit_time = #{editTime,jdbcType=TIMESTAMP}
|
||||||
|
<trim prefix="WHERE" prefixOverrides="AND |OR ">
|
||||||
|
<if test="cfgId !=null ">
|
||||||
|
AND cfg_id = #{cfgId,jdbcType=BIGINT}
|
||||||
|
</if>
|
||||||
|
<if test="compileId !=null ">
|
||||||
|
AND compile_id = #{compileId,jdbcType=INTEGER}
|
||||||
|
</if>
|
||||||
|
and function_id=#{functionId,jdbcType=INTEGER}
|
||||||
|
</trim>
|
||||||
|
</update>
|
||||||
<!-- 删除区域IP配置 -->
|
<!-- 删除区域IP配置 -->
|
||||||
<!-- 删除voipIp信息 -->
|
<!-- 删除voipIp信息 -->
|
||||||
<delete id="deleteAreaIpCfgByCfgId" parameterType="com.nis.domain.configuration.AreaIpCfg" >
|
<delete id="deleteAreaIpCfgByCfgId" parameterType="com.nis.domain.configuration.AreaIpCfg" >
|
||||||
delete from area_ip_cfg
|
delete from area_ip_cfg where cfg_id = #{cfgId,jdbcType=INTEGER}
|
||||||
<where>
|
|
||||||
<if test="areaIpCfg != null and areaIpCfg.cfgId != null" >
|
|
||||||
and cfg_id = #{areaIpCfg.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>
|
</delete>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -31,7 +31,7 @@ public interface AvContentCfgDao {
|
|||||||
public void updateAvVoipAccount(CfgIndexInfo entity);
|
public void updateAvVoipAccount(CfgIndexInfo entity);
|
||||||
public void deleteAvVoipIp(CfgIndexInfo entity);
|
public void deleteAvVoipIp(CfgIndexInfo entity);
|
||||||
public void deleteAvVoipAccount(CfgIndexInfo entity);
|
public void deleteAvVoipAccount(CfgIndexInfo entity);
|
||||||
public AvContIpCfg findVoipIpCfgById(AvContIpCfg entity) ;
|
public AvContIpCfg findContIpCfgById(AvContIpCfg entity) ;
|
||||||
public void insertAvContIp(AvContIpCfg entity);
|
public void insertAvContIp(AvContIpCfg entity);
|
||||||
public void updateAvContIp(AvContIpCfg entity);
|
public void updateAvContIp(AvContIpCfg entity);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,8 +177,8 @@ public class AvContentCfgService extends BaseService{
|
|||||||
//保存区域IP信息
|
//保存区域IP信息
|
||||||
if(entity.getAreaCfg()!=null&&entity.getAreaCfg().size()>0){
|
if(entity.getAreaCfg()!=null&&entity.getAreaCfg().size()>0){
|
||||||
for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) {
|
for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) {
|
||||||
entity.setAreaIpCfg(areaIpCfg);
|
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
areaIpCfgDao.saveAreaIpCfgFromCfgIndexInfo(entity);
|
areaIpCfgDao.saveAreaIpCfg(areaIpCfg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//保存cfgIndexInfo
|
//保存cfgIndexInfo
|
||||||
@@ -237,7 +237,7 @@ public class AvContentCfgService extends BaseService{
|
|||||||
avContentCfgDao.insertAvVoipAccount(entity);
|
avContentCfgDao.insertAvVoipAccount(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!StringUtil.isEmpty(entity.getAreaCfg())){
|
if(!StringUtil.isEmpty(entity.getAreaCfg())){
|
||||||
for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) {
|
for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) {
|
||||||
if(!StringUtil.isEmpty(areaIpCfg.getCfgId())){
|
if(!StringUtil.isEmpty(areaIpCfg.getCfgId())){
|
||||||
@@ -247,14 +247,14 @@ public class AvContentCfgService extends BaseService{
|
|||||||
//修改
|
//修改
|
||||||
entity.setEditorId(UserUtils.getUser().getId());
|
entity.setEditorId(UserUtils.getUser().getId());
|
||||||
entity.setEditTime(editTime);
|
entity.setEditTime(editTime);
|
||||||
entity.setAreaIpCfg(areaIpCfg);
|
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType","cfgId"});
|
||||||
areaIpCfgDao.updateAreaIpCfgFromCfgIndexInfo(entity);
|
areaIpCfgDao.updateAreaIpCfg(areaIpCfg);
|
||||||
}else{
|
}else{
|
||||||
//新增
|
//新增
|
||||||
entity.setCreatorId(UserUtils.getUser().getId());
|
entity.setCreatorId(UserUtils.getUser().getId());
|
||||||
entity.setCreateTime(createTime);
|
entity.setCreateTime(createTime);
|
||||||
entity.setAreaIpCfg(areaIpCfg);
|
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType"});
|
||||||
areaIpCfgDao.saveAreaIpCfgFromCfgIndexInfo(entity);
|
areaIpCfgDao.saveAreaIpCfg(areaIpCfg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -288,8 +288,7 @@ public class AvContentCfgService extends BaseService{
|
|||||||
CfgIndexInfo cfg=new CfgIndexInfo();
|
CfgIndexInfo cfg=new CfgIndexInfo();
|
||||||
AreaIpCfg areaIpCfg=new AreaIpCfg();
|
AreaIpCfg areaIpCfg=new AreaIpCfg();
|
||||||
areaIpCfg.setCfgId(Long.parseLong(cfgId));
|
areaIpCfg.setCfgId(Long.parseLong(cfgId));
|
||||||
cfg.setAreaIpCfg(areaIpCfg);
|
areaIpCfgDao.deleteAreaIpCfgByCfgId(areaIpCfg);
|
||||||
areaIpCfgDao.deleteAreaIpCfgByCfgId(cfg);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -319,7 +318,9 @@ public class AvContentCfgService extends BaseService{
|
|||||||
avContentCfgDao.updateAvVoipIp(entity);
|
avContentCfgDao.updateAvVoipIp(entity);
|
||||||
avContentCfgDao.updateAvVoipAccount(entity);
|
avContentCfgDao.updateAvVoipAccount(entity);
|
||||||
avContentCfgDao.updateCfgIndexInfo(entity);
|
avContentCfgDao.updateCfgIndexInfo(entity);
|
||||||
areaIpCfgDao.updateAreaIpCfgFromCfgIndexInfo(entity);
|
AreaIpCfg areaIpCfg=new AreaIpCfg();
|
||||||
|
BeanUtils.copyProperties(entity, areaIpCfg);
|
||||||
|
areaIpCfgDao.updateAreaIpCfgValid(areaIpCfg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
@@ -351,11 +352,13 @@ public class AvContentCfgService extends BaseService{
|
|||||||
avContentCfgDao.updateAvVoipIp(entity);
|
avContentCfgDao.updateAvVoipIp(entity);
|
||||||
avContentCfgDao.updateAvVoipAccount(entity);
|
avContentCfgDao.updateAvVoipAccount(entity);
|
||||||
avContentCfgDao.updateCfgIndexInfo(entity);
|
avContentCfgDao.updateCfgIndexInfo(entity);
|
||||||
areaIpCfgDao.updateAreaIpCfgFromCfgIndexInfo(entity);
|
AreaIpCfg areaIpCfg=new AreaIpCfg();
|
||||||
|
BeanUtils.copyProperties(entity, areaIpCfg,new String[]{"cfgRegionCode","cfgType","cfgId"});
|
||||||
|
areaIpCfgDao.updateAreaIpCfg(areaIpCfg);
|
||||||
|
|
||||||
voipIpList=avContentCfgDao.findVoipIpCfgList(entity);
|
voipIpList=avContentCfgDao.findVoipIpCfgList(entity);
|
||||||
voipAccountList=avContentCfgDao.findVoipAccountCfgList(entity);
|
voipAccountList=avContentCfgDao.findVoipAccountCfgList(entity);
|
||||||
areaIpCfgList=areaIpCfgDao.findAreaIpCfgList(entity);
|
areaIpCfgList=areaIpCfgDao.getByCompileId(entity.getCompileId());
|
||||||
|
|
||||||
ToMaatBean maatBean = new ToMaatBean();
|
ToMaatBean maatBean = new ToMaatBean();
|
||||||
MaatCfg maatCfg = new MaatCfg();
|
MaatCfg maatCfg = new MaatCfg();
|
||||||
@@ -455,11 +458,37 @@ public class AvContentCfgService extends BaseService{
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public AvContIpCfg getContIpCfgById(AvContIpCfg entity) {
|
public AvContIpCfg getContIpCfgById(AvContIpCfg entity) {
|
||||||
return avContentCfgDao.findVoipIpCfgById(entity);
|
return avContentCfgDao.findContIpCfgById(entity);
|
||||||
}
|
}
|
||||||
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
@Transactional(readOnly=false,rollbackFor=RuntimeException.class)
|
||||||
public void saveOrUpdateAvContIp(AvContIpCfg entity){
|
public void saveOrUpdateAvContIp(AvContIpCfg entity,String areaCfgIds){
|
||||||
Date createTime=new Date();
|
Date createTime=new Date();
|
||||||
|
|
||||||
|
//区域IPsetAreaEffectiveIds设置
|
||||||
|
List<AreaIpCfg> areaCfg=entity.getAreaCfg();
|
||||||
|
List<AreaBean> areaIsps=entity.getAreaIsp();
|
||||||
|
if(Constants.IS_AREA_EFFECTIVE_NO==entity.getIsAreaEffective()){
|
||||||
|
entity.setAreaEffectiveIds("");
|
||||||
|
entity.setAreaType(null);
|
||||||
|
}else if(Constants.IS_AREA_EFFECTIVE_YES==entity.getIsAreaEffective()){
|
||||||
|
if(Constants.AREA_EFFECTIVE_TYPE_AREA_ISP==entity.getAreaType()&&areaIsps!=null&&areaIsps.size()>0){
|
||||||
|
StringBuffer areaEffectiveIds=new StringBuffer();
|
||||||
|
for(int i=0;i<areaIsps.size();i++){
|
||||||
|
if(StringUtils.isNotBlank(areaIsps.get(i).getIsp())){
|
||||||
|
areaEffectiveIds.append(areaIsps.get(i).getArea()+":"+areaIsps.get(i).getIsp());
|
||||||
|
}else{
|
||||||
|
areaEffectiveIds.append(areaIsps.get(i).getArea());
|
||||||
|
}
|
||||||
|
if(i!=areaIsps.size()-1){
|
||||||
|
areaEffectiveIds.append(",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
entity.setAreaEffectiveIds(areaEffectiveIds.toString());
|
||||||
|
}else if(Constants.AREA_EFFECTIVE_TYPE_AREA_IP==entity.getAreaType()&&areaCfg!=null&&areaCfg.size()>0){
|
||||||
|
entity.setAreaEffectiveIds("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//新增
|
//新增
|
||||||
if(entity.getCfgId()==null){
|
if(entity.getCfgId()==null){
|
||||||
entity.setCreatorId(UserUtils.getUser().getId());
|
entity.setCreatorId(UserUtils.getUser().getId());
|
||||||
@@ -470,7 +499,6 @@ public class AvContentCfgService extends BaseService{
|
|||||||
List<Integer> compileIds = new ArrayList<Integer>();
|
List<Integer> compileIds = new ArrayList<Integer>();
|
||||||
try {
|
try {
|
||||||
compileIds = ConfigServiceUtil.getId(1,1);
|
compileIds = ConfigServiceUtil.getId(1,1);
|
||||||
//compileIds.add((int)Math.floor(Math.random()*1000000+1));
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
logger.info("获取编译ID出错");
|
logger.info("获取编译ID出错");
|
||||||
@@ -478,6 +506,15 @@ public class AvContentCfgService extends BaseService{
|
|||||||
}
|
}
|
||||||
if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){
|
if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){
|
||||||
entity.setCompileId(compileIds.get(0));
|
entity.setCompileId(compileIds.get(0));
|
||||||
|
|
||||||
|
//保存区域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
|
//保存cfgIndexInfo
|
||||||
avContentCfgDao.insertAvContIp(entity);
|
avContentCfgDao.insertAvContIp(entity);
|
||||||
}else{
|
}else{
|
||||||
@@ -489,6 +526,39 @@ public class AvContentCfgService extends BaseService{
|
|||||||
Date editTime=new Date();
|
Date editTime=new Date();
|
||||||
entity.setIsValid(0);
|
entity.setIsValid(0);
|
||||||
entity.setIsAudit(0);
|
entity.setIsAudit(0);
|
||||||
|
|
||||||
|
areaCfgIds=!StringUtil.isEmpty(areaCfgIds)? ","+areaCfgIds:"";
|
||||||
|
|
||||||
|
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"});
|
||||||
|
areaIpCfgDao.saveAreaIpCfg(areaIpCfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//delete 真是删除areaIpCfg信息
|
||||||
|
if(!StringUtil.isEmpty(areaCfgIds.replaceAll(",", ""))){
|
||||||
|
areaCfgIds=areaCfgIds.substring(1,areaCfgIds.length());
|
||||||
|
for (String cfgId : areaCfgIds.split(",")) {
|
||||||
|
AreaIpCfg areaIpCfg=new AreaIpCfg();
|
||||||
|
areaIpCfg.setCfgId(Long.parseLong(cfgId));
|
||||||
|
areaIpCfgDao.deleteAreaIpCfgByCfgId(areaIpCfg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
entity.setEditorId(UserUtils.getUser().getId());
|
entity.setEditorId(UserUtils.getUser().getId());
|
||||||
entity.setEditTime(editTime);
|
entity.setEditTime(editTime);
|
||||||
avContentCfgDao.updateAvContIp(entity);
|
avContentCfgDao.updateAvContIp(entity);
|
||||||
|
|||||||
@@ -5,40 +5,6 @@
|
|||||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
areaControlInit();
|
|
||||||
$("input[name='isAreaEffective']").on('change',function(){
|
|
||||||
var val=$(this).val();
|
|
||||||
if(val==1){
|
|
||||||
$(".areaType").removeClass("hidden");
|
|
||||||
if($("input[name='areaType']:checked").val()==1){//areaISP
|
|
||||||
$("#areaIsp").removeClass("hidden");
|
|
||||||
}else if($("input[name='areaType']:checked").val()==0){//areaIp
|
|
||||||
$("#areaIp").removeClass("hidden");
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
$(".areaType").addClass("hidden");
|
|
||||||
$("#areaIp").addClass("hidden");
|
|
||||||
$("#areaIsp").addClass("hidden");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$("select[name$='ipType']").on("change",function(){
|
|
||||||
switchIpType($(this));
|
|
||||||
});
|
|
||||||
$("input[name='areaType']").on('change',function(){
|
|
||||||
var val=$(this).val();
|
|
||||||
if($(this).is(":visible")){
|
|
||||||
if(val==0){
|
|
||||||
$("#areaIp").removeClass("hidden");
|
|
||||||
$("#areaIsp").addClass("hidden");
|
|
||||||
}else{
|
|
||||||
$("#areaIsp").removeClass("hidden");
|
|
||||||
$("#areaIp").addClass("hidden");
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
$("#areaIsp").addClass("hidden");
|
|
||||||
$("#areaIp").addClass("hidden");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$("#cancel").on("click",function(){
|
$("#cancel").on("click",function(){
|
||||||
window.history.back();
|
window.history.back();
|
||||||
});
|
});
|
||||||
@@ -123,7 +89,7 @@ $(function(){
|
|||||||
</div>
|
</div>
|
||||||
<!-- desc and action -->
|
<!-- desc and action -->
|
||||||
<%@include file="/WEB-INF/include/form/ipInfo.jsp" %>
|
<%@include file="/WEB-INF/include/form/ipInfo.jsp" %>
|
||||||
<%-- <%@include file="/WEB-INF/include/form/areaInfo.jsp" %> --%>
|
<%@include file="/WEB-INF/include/form/areaInfo.jsp" %>
|
||||||
<input type="hidden" name="isAreaEffective" value="0">
|
<input type="hidden" name="isAreaEffective" value="0">
|
||||||
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
|
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -117,7 +117,7 @@
|
|||||||
<button type="button" class="btn btn-default" id="filter-btn"> <spring:message code="filter"/> <i class="fa fa-angle-double-down"></i></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>
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
<shiro:hasPermission name="avContIp:config">
|
<shiro:hasPermission name="avContentIp:config">
|
||||||
<sys:delRow url="${ctx}/ntc/av/contentIpForm" id="contentTable" label="update"></sys:delRow>
|
<sys:delRow url="${ctx}/ntc/av/contentIpForm" id="contentTable" label="update"></sys:delRow>
|
||||||
<sys:delRow url="${ctx}/ntc/av/updateAvContIpValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
<sys:delRow url="${ctx}/ntc/av/updateAvContIpValid?isValid=-1&functionId=${cfg.functionId }" id="contentTable" label="delete"></sys:delRow>
|
||||||
</shiro:hasPermission>
|
</shiro:hasPermission>
|
||||||
|
|||||||
@@ -71,59 +71,131 @@ $(function(){
|
|||||||
if($(this).is(":visible")){
|
if($(this).is(":visible")){
|
||||||
if(val==0){
|
if(val==0){
|
||||||
$("#areaIp").removeClass("hidden");
|
$("#areaIp").removeClass("hidden");
|
||||||
/*$("#areaIsp").find(".container-fluid:visible").find("input,select,div,button").each(function(){
|
|
||||||
$(this).attr("disabled","true");
|
|
||||||
});*/
|
|
||||||
$("#areaIsp").addClass("hidden");
|
$("#areaIsp").addClass("hidden");
|
||||||
if($("#areaIp").find(".container-fluid:visible").size() <1){
|
if($("#areaIp").find(".container-fluid:visible").size() <1){
|
||||||
$("#areaIp").find(".glyphicon-plus").click();
|
$("#areaIp").find(".glyphicon-plus").click();
|
||||||
}
|
}
|
||||||
/*$("#areaIp").find(".container-fluid:visible").find("input,select,div,button").each(function(){
|
$("#areaIp").find(".container-fluid").each(function(){
|
||||||
$(this).removeAttr("disabled");
|
$(this).find("input,select,div,button").each(function(){
|
||||||
});*/
|
$(this).removeAttr("disabled");
|
||||||
|
$(this).removeClass("disabled");
|
||||||
|
})
|
||||||
|
});
|
||||||
|
$("#areaIsp").find(".container-fluid").each(function(){
|
||||||
|
$(this).find("input,select,div,button").each(function(){
|
||||||
|
$(this).attr("disabled","disabled");
|
||||||
|
})
|
||||||
|
});
|
||||||
}else{
|
}else{
|
||||||
$("#areaIsp").removeClass("hidden");
|
$("#areaIsp").removeClass("hidden");
|
||||||
/*$("#areaIp").find(".container-fluid:visible").find("input,select,div,button").each(function(){
|
|
||||||
$(this).attr("disabled","true");
|
|
||||||
});*/
|
|
||||||
$("#areaIp").addClass("hidden");
|
$("#areaIp").addClass("hidden");
|
||||||
if($("#areaIsp").find(".container-fluid:visible").size() <1){
|
if($("#areaIsp").find(".container-fluid:visible").size() <1){
|
||||||
$("#areaIsp").find(".glyphicon-plus").click();
|
$("#areaIsp").find(".glyphicon-plus").click();
|
||||||
}
|
}
|
||||||
/*$("#areaIsp").find(".container-fluid:visible").find("input,select,div,button").each(function(){
|
$("#areaIsp").find(".container-fluid").each(function(){
|
||||||
$(this).removeAttr("disabled");
|
$(this).find("input,select,div,button").each(function(){
|
||||||
});*/
|
$(this).removeAttr("disabled");
|
||||||
|
$(this).removeClass("disabled");
|
||||||
|
})
|
||||||
|
});
|
||||||
|
$("#areaIp").find(".container-fluid").each(function(){
|
||||||
|
$(this).find("input,select,div,button").each(function(){
|
||||||
|
$(this).attr("disabled","disabled");
|
||||||
|
})
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
$("#areaIsp").addClass("hidden");
|
$("#areaIsp").addClass("hidden");
|
||||||
$("#areaIp").addClass("hidden");
|
$("#areaIp").addClass("hidden");
|
||||||
|
$("#areaIsp").find(".container-fluid").each(function(){
|
||||||
|
$(this).find("input,select,div,button").each(function(){
|
||||||
|
$(this).attr("disabled","disabled");
|
||||||
|
})
|
||||||
|
});
|
||||||
|
$("#areaIp").find(".container-fluid").each(function(){
|
||||||
|
$(this).find("input,select,div,button").each(function(){
|
||||||
|
$(this).attr("disabled","disabled");
|
||||||
|
})
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$("input[name='isAreaEffective']").on('change',function(){
|
$("input[name='isAreaEffective']").on('change',function(){
|
||||||
var val=$(this).val();
|
var val=$(this).val();
|
||||||
if(val==1){
|
if(val==1){
|
||||||
|
$(".areaType").find("input,select,div,button").each(function(){
|
||||||
|
$(this).removeAttr("disabled");
|
||||||
|
$(this).removeClass("disabled");
|
||||||
|
});
|
||||||
$(".areaType").removeClass("hidden");
|
$(".areaType").removeClass("hidden");
|
||||||
if($("input[name='areaType']:checked").val()==1){//areaISP
|
if($("input[name='areaType']:checked").val()==1){//areaISP
|
||||||
$("#areaIsp").removeClass("hidden");
|
$("#areaIsp").removeClass("hidden");
|
||||||
if($("#areaIsp").find(".container-fluid:visible").size() <1){
|
if($("#areaIsp").find(".container-fluid:visible").size() <1){
|
||||||
$("#areaIsp").find(".glyphicon-plus").click();
|
$("#areaIsp").find(".glyphicon-plus").click();
|
||||||
}
|
}
|
||||||
|
$("#areaIsp").find(".container-fluid").each(function(){
|
||||||
|
$(this).find("input,select,div,button").each(function(){
|
||||||
|
$(this).removeAttr("disabled");
|
||||||
|
$(this).removeClass("disabled");
|
||||||
|
})
|
||||||
|
});
|
||||||
|
$("#areaIp").find(".container-fluid").each(function(){
|
||||||
|
$(this).find("input,select,div,button").each(function(){
|
||||||
|
$(this).attr("disabled","disabled");
|
||||||
|
})
|
||||||
|
});
|
||||||
}else if($("input[name='areaType']:checked").val()==0){//areaIp
|
}else if($("input[name='areaType']:checked").val()==0){//areaIp
|
||||||
$("#areaIp").removeClass("hidden");
|
$("#areaIp").removeClass("hidden");
|
||||||
if($("#areaIp").find(".container-fluid:visible").size() <1){
|
if($("#areaIp").find(".container-fluid:visible").size() <1){
|
||||||
$("#areaIp").find(".glyphicon-plus").click();
|
$("#areaIp").find(".glyphicon-plus").click();
|
||||||
}
|
}
|
||||||
|
$("#areaIp").find(".container-fluid").each(function(){
|
||||||
|
$(this).find("input,select,div,button").each(function(){
|
||||||
|
$(this).removeAttr("disabled");
|
||||||
|
$(this).removeClass("disabled");
|
||||||
|
})
|
||||||
|
});
|
||||||
|
$("#areaIsp").find(".container-fluid").each(function(){
|
||||||
|
$(this).find("input,select,div,button").each(function(){
|
||||||
|
$(this).attr("disabled","disabled");
|
||||||
|
})
|
||||||
|
});
|
||||||
}else{
|
}else{
|
||||||
$(".areaType").find("[value='1']").prop("checked",true);
|
$(".areaType").find("[value='1']").prop("checked",true);
|
||||||
$("#areaIsp").removeClass("hidden");
|
$("#areaIsp").removeClass("hidden");
|
||||||
if($("#areaIsp").find(".container-fluid:visible").size() <1){
|
if($("#areaIsp").find(".container-fluid:visible").size() <1){
|
||||||
$("#areaIsp").find(".glyphicon-plus").click();
|
$("#areaIsp").find(".glyphicon-plus").click();
|
||||||
}
|
}
|
||||||
|
$("#areaIsp").find(".container-fluid").each(function(){
|
||||||
|
$(this).find("input,select,div,button").each(function(){
|
||||||
|
$(this).removeAttr("disabled");
|
||||||
|
$(this).removeClass("disabled");
|
||||||
|
})
|
||||||
|
});
|
||||||
|
$("#areaIp").find(".container-fluid").each(function(){
|
||||||
|
$(this).find("input,select,div,button").each(function(){
|
||||||
|
$(this).attr("disabled","disabled");
|
||||||
|
})
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
$(".areaType").addClass("hidden");
|
$(".areaType").addClass("hidden");
|
||||||
$("#areaIp").addClass("hidden");
|
$("#areaIp").addClass("hidden");
|
||||||
$("#areaIsp").addClass("hidden");
|
$("#areaIsp").addClass("hidden");
|
||||||
|
|
||||||
|
$(".areaType").find("input,select,div,button").each(function(){
|
||||||
|
$(this).attr("disabled","disabled");
|
||||||
|
});
|
||||||
|
$("#areaIsp").find(".container-fluid").each(function(){
|
||||||
|
$(this).find("input,select,div,button").each(function(){
|
||||||
|
$(this).attr("disabled","disabled");
|
||||||
|
})
|
||||||
|
});
|
||||||
|
$("#areaIp").find(".container-fluid").each(function(){
|
||||||
|
$(this).find("input,select,div,button").each(function(){
|
||||||
|
$(this).attr("disabled","disabled");
|
||||||
|
})
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
areaControlInit();
|
areaControlInit();
|
||||||
|
|||||||
Reference in New Issue
Block a user