diff --git a/src/main/java/com/nis/domain/configuration/AvContIpCfg.java b/src/main/java/com/nis/domain/configuration/AvContIpCfg.java new file mode 100644 index 000000000..17c8b8d44 --- /dev/null +++ b/src/main/java/com/nis/domain/configuration/AvContIpCfg.java @@ -0,0 +1,18 @@ +package com.nis.domain.configuration; + +/** + * @ClassName: AvVoipIpCfg.java + * @Description: 音视频Cont IP + * @author (dell) + * @date 2018年2月6日 上午8:29:26 + * @version V1.0 + */ +public class AvContIpCfg extends BaseIpCfg { + + /** + * + */ + private static final long serialVersionUID = 1249923766365462700L; + + +} diff --git a/src/main/java/com/nis/domain/configuration/AvVoipAccountCfg.java b/src/main/java/com/nis/domain/configuration/AvVoipAccountCfg.java index 3988b16ff..77c368f0b 100644 --- a/src/main/java/com/nis/domain/configuration/AvVoipAccountCfg.java +++ b/src/main/java/com/nis/domain/configuration/AvVoipAccountCfg.java @@ -1,5 +1,6 @@ package com.nis.domain.configuration; + /** * @ClassName: AvVoipAccountCfg.java * @Description: TODO @@ -7,7 +8,7 @@ package com.nis.domain.configuration; * @date 2018年2月6日 上午8:18:55 * @version V1.0 */ -public class AvVoipAccountCfg extends ComplexkeywordCfg{ +public class AvVoipAccountCfg extends BaseStringCfg{ private static final long serialVersionUID = -7398698517584394431L; diff --git a/src/main/java/com/nis/domain/configuration/CfgIndexInfo.java b/src/main/java/com/nis/domain/configuration/CfgIndexInfo.java index 2adcdbd10..341fdc732 100644 --- a/src/main/java/com/nis/domain/configuration/CfgIndexInfo.java +++ b/src/main/java/com/nis/domain/configuration/CfgIndexInfo.java @@ -27,6 +27,7 @@ public class CfgIndexInfo extends BaseCfg { private static final String tableName="cfg_index_info"; private List voipAccounts;//Add表单使用 private List voipIps; //Add表单使用 + private AreaIpCfg areaIpCfg; private AvVoipAccountCfg voipAccount;//Search使用 private AvVoipIpCfg voipIp;//Search使用 private IpPortCfg ipPort; @@ -142,5 +143,11 @@ public class CfgIndexInfo extends BaseCfg { public static String getTablename() { return tableName; } + public AreaIpCfg getAreaIpCfg() { + return areaIpCfg; + } + public void setAreaIpCfg(AreaIpCfg areaIpCfg) { + this.areaIpCfg = areaIpCfg; + } } diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java b/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java index 256734a19..5936f7a70 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/AvContentController.java @@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.nis.domain.Page; +import com.nis.domain.configuration.AvContIpCfg; import com.nis.domain.configuration.AvVoipAccountCfg; import com.nis.domain.configuration.CfgIndexInfo; import com.nis.domain.configuration.AvVoipIpCfg; @@ -36,6 +37,7 @@ public class AvContentController extends BaseController { if(!StringUtil.isEmpty(ids)){ cfg.setCompileId(Integer.parseInt(ids)); cfg = avContentCfgService.getCfgIndexInfo(cfg); + initUpdateFormCondition(model, cfg); }else{ List avVoipAccountCfgs=new ArrayList(); avVoipAccountCfgs.add(new AvVoipAccountCfg()); @@ -43,9 +45,9 @@ public class AvContentController extends BaseController { List avVoipIpCfgs=new ArrayList(); avVoipIpCfgs.add(new AvVoipIpCfg()); cfg.setVoipIps(avVoipIpCfgs); + initFormCondition(model,cfg); } - initFormCondition(model,cfg); model.addAttribute("_cfg", cfg); return "/cfg/av/voip/voipForm"; } @@ -55,10 +57,11 @@ public class AvContentController extends BaseController { @RequestMapping(value = {"/saveVoip"}) public String saveVoip(Model model,HttpServletRequest request,HttpServletResponse response, @ModelAttribute("cfg")CfgIndexInfo cfg, + @ModelAttribute("areaCfgIds")String areaCfgIds, @ModelAttribute("voipIpIds")String voipIpIds, @ModelAttribute("voipAccountIds")String voipAccountIds){ try{ - avContentCfgService.saveOrUpdateAvVoip(cfg,voipIpIds,voipAccountIds); + avContentCfgService.saveOrUpdateAvVoip(cfg,voipIpIds,voipAccountIds,areaCfgIds); addMessage(model,"save_success"); }catch(Exception e){ logger.error("voip信息保存失败",e); @@ -117,18 +120,37 @@ public class AvContentController extends BaseController { } //视频文本内容配置列表 - @RequestMapping(value = {"/contIpList"}) - public String contIpList(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")CfgIndexInfo entity){ - if(entity.getVoipIp()== null){ - entity.setVoipIp(new AvVoipIpCfg()); - } - if(entity.getVoipAccount()== null){ - entity.setVoipAccount(new AvVoipAccountCfg()); - } - Page page = avContentCfgService.findPage(new Page(request, response,"r"), entity); + @RequestMapping(value = {"/contentIpList"}) + public String contIpList(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")AvContIpCfg entity){ + Page page = avContentCfgService.findContIpPage(new Page(request, response,"r"), entity); model.addAttribute("page", page); initPageCondition(model); - return "/cfg/av/voip/voipList"; + return "/cfg/av/contIp/contIpList"; + } + //音视频文本内容新增界面 + @RequestMapping(value = {"/contentIpForm"}) + public String contIpForm(Model model,HttpServletRequest request,HttpServletResponse response,String ids,@ModelAttribute("cfg")AvContIpCfg cfg){ + if(!StringUtil.isEmpty(ids)){ + cfg = avContentCfgService.getContIpCfgById(cfg); + } + initFormCondition(model,cfg); + model.addAttribute("_cfg", cfg); + return "/cfg/av/contIp/contIpForm"; } + //保存voip信息 + @RequestMapping(value = {"/saveContIp"}) + public String saveContIp(Model model,HttpServletRequest request,HttpServletResponse response, + @ModelAttribute("cfg")AvContIpCfg cfg){ + try{ + avContentCfgService.saveOrUpdateAvContIp(cfg); + addMessage(model,"save_success"); + }catch(Exception e){ + logger.error("信息保存失败",e); + e.printStackTrace(); + addMessage(model,"save_failed"); + } + + return "redirect:" + adminPath +"/ntc/av/contentIpList?functionId="+cfg.getFunctionId(); + } } diff --git a/src/main/java/com/nis/web/dao/configuration/AreaIpCfgDao.java b/src/main/java/com/nis/web/dao/configuration/AreaIpCfgDao.java index 0474fde20..079a170d9 100644 --- a/src/main/java/com/nis/web/dao/configuration/AreaIpCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/AreaIpCfgDao.java @@ -5,6 +5,7 @@ import java.util.List; import org.apache.ibatis.annotations.Param; import com.nis.domain.configuration.AreaIpCfg; +import com.nis.domain.configuration.CfgIndexInfo; import com.nis.web.dao.CrudDao; import com.nis.web.dao.MyBatisDao; @@ -16,6 +17,10 @@ import com.nis.web.dao.MyBatisDao; @MyBatisDao public interface AreaIpCfgDao extends CrudDao{ public List getByCompileId(@Param("compileId") int compileId) ; + public List findAreaIpCfgList(CfgIndexInfo entity); public void saveAreaIpCfg(AreaIpCfg entity); + public void saveAreaIpCfgFromCfgIndexInfo(CfgIndexInfo entity); + public void updateAreaIpCfgFromCfgIndexInfo(CfgIndexInfo entity); public void deleteAreaIpCfg(AreaIpCfg entity); + public void deleteAreaIpCfgByCfgId(CfgIndexInfo entity); } diff --git a/src/main/java/com/nis/web/dao/configuration/AreaIpCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AreaIpCfgDao.xml index 2092f3142..ef8437aa7 100644 --- a/src/main/java/com/nis/web/dao/configuration/AreaIpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AreaIpCfgDao.xml @@ -53,7 +53,26 @@ AND IS_VALID!=-1 - + + @@ -125,8 +144,201 @@ #{cfgRegionCode,jdbcType=INTEGER} ) + + + + SELECT LAST_INSERT_ID() + + 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} + ) + + + + update area_ip_cfg + + + + cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, + + + action = #{action,jdbcType=INTEGER}, + + + is_valid = #{isValid,jdbcType=INTEGER}, + + + is_audit = #{isAudit,jdbcType=INTEGER}, + + + editor_id = #{editorId,jdbcType=INTEGER}, + + + edit_time = #{editTime,jdbcType=TIMESTAMP}, + + + AUDITOR_ID = #{auditorId,jdbcType=INTEGER}, + + + AUDIT_TIME = #{auditTime,jdbcType=TIMESTAMP}, + + + COMPILE_ID = #{compileId,jdbcType=TIMESTAMP}, + + + request_id = #{requestId,jdbcType=INTEGER}, + + + is_area_effective = #{isAreaEffective,jdbcType=INTEGER}, + + + classify = #{classify,jdbcType=VARCHAR}, + + + attribute = #{attribute,jdbcType=VARCHAR}, + + + lable = #{lable,jdbcType=VARCHAR}, + + + area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}, + + + function_id = #{functionId,jdbcType=INTEGER}, + + + service_id = #{serviceId,jdbcType=INTEGER}, + + + ip_type = #{areaIpCfg.ipType,jdbcType=INTEGER}, + + + src_ip_address = #{areaIpCfg.srcIpAddress,jdbcType=VARCHAR}, + + + ip_pattern = #{areaIpCfg.ipPattern,jdbcType=INTEGER}, + + + port_pattern = #{areaIpCfg.portPattern,jdbcType=INTEGER}, + + + src_port = #{areaIpCfg.srcPort,jdbcType=VARCHAR}, + + + protocol = #{areaIpCfg.protocol,jdbcType=INTEGER}, + + + protocol_id = #{areaIpCfg.protocolId,jdbcType=INTEGER}, + + + direction = #{areaIpCfg.direction,jdbcType=INTEGER}, + + + dest_port = #{areaIpCfg.destPort,jdbcType=VARCHAR}, + + + dest_ip_address = #{areaIpCfg.destIpAddress,jdbcType=VARCHAR}, + + + cfg_type = #{areaIpCfg.cfgType,jdbcType=VARCHAR}, + + + cfg_region_code = #{areaIpCfg.cfgRegionCode,jdbcType=INTEGER}, + + + + + + and cfg_id = #{areaIpCfg.cfgId,jdbcType=INTEGER} + + + and compile_id = #{compileId,jdbcType=INTEGER} + + + and function_id = #{functionId,jdbcType=INTEGER} + + + delete from area_ip_cfg where compile_id=#{compileId} and function_id=#{functionId} + + + + delete from area_ip_cfg + + + and cfg_id = #{areaIpCfg.cfgId,jdbcType=INTEGER} + + + and compile_id = #{compileId,jdbcType=INTEGER} + + + and function_id = #{functionId,jdbcType=INTEGER} + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.java b/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.java index ebf7f43f6..36179a6e4 100644 --- a/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.java +++ b/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.java @@ -9,6 +9,7 @@ import com.nis.domain.configuration.AvVoipAccountCfg; import com.nis.domain.configuration.AvVoipIpCfg; import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.CfgIndexInfo; +import com.nis.domain.configuration.AvContIpCfg; import com.nis.domain.configuration.AvFileSampleCfg; import com.nis.domain.configuration.AvSignSampleCfg; import com.nis.web.dao.CrudDao; @@ -18,6 +19,7 @@ import com.nis.web.dao.MyBatisDao; @MyBatisDao public interface AvContentCfgDao { public List findVoipList(CfgIndexInfo entity) ; + public List findContIpList(AvContIpCfg entity) ; public List findVoipIpCfgList(CfgIndexInfo entity); public List findVoipAccountCfgList(CfgIndexInfo entity); public CfgIndexInfo getCfgIndexInfo(CfgIndexInfo entity); @@ -29,4 +31,7 @@ public interface AvContentCfgDao { public void updateAvVoipAccount(CfgIndexInfo entity); public void deleteAvVoipIp(CfgIndexInfo entity); public void deleteAvVoipAccount(CfgIndexInfo entity); + public AvContIpCfg findVoipIpCfgById(AvContIpCfg entity) ; + public void insertAvContIp(AvContIpCfg entity); + public void updateAvContIp(AvContIpCfg entity); } diff --git a/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.xml index c41a2fdf2..8f837e31c 100644 --- a/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/AvContentCfgDao.xml @@ -61,7 +61,6 @@ - @@ -89,6 +88,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + r.CFG_ID,r.CFG_DESC,r.ACTION,r.IS_VALID,r.IS_AUDIT, r.CREATOR_ID,r.CREATE_TIME,r.EDITOR_ID,r.EDIT_TIME,r.AUDITOR_ID,r.AUDIT_TIME, @@ -104,12 +138,20 @@ ,r.area_effective_ids,r.function_id,r.cfg_region_code - r.cfg_id,r.cfg_desc,r.district,r.cfg_keywords,r.cfg_type, + r.cfg_id,r.cfg_desc,r.cfg_keywords,r.cfg_type, r.action,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id,r.edit_time, r.auditor_id, 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 - + + r.cfg_id,r.cfg_desc,r.ip_type,r.src_ip_address,r.ip_pattern,r.port_pattern,r.src_port + ,r.protocol,r.protocol_id,r.direction,r.cfg_type,r.action,r.dest_port,r.dest_ip_address + ,r.is_valid,r.is_audit,r.creator_id,r.create_time,r.editor_id + ,r.edit_time,r.auditor_id,r.audit_time,r.service_id,r.request_id, + r.compile_id,r.is_area_effective,r.classify,r.attribute,r.lable + ,r.area_effective_ids,r.function_id,r.cfg_region_code + + + SELECT + + + , s.name as creator_name,e.name as editor_name,u.name as auditor_name + ,ri.request_title as requestName + + FROM av_cont_ip_cfg 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 + + + + AND ${page.where} + + + AND r.CFG_ID=#{cfgId,jdbcType=BIGINT} + + + AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%') + + + AND r.ACTION=#{action,jdbcType=INTEGER} + + + AND r.IS_VALID=#{isValid,jdbcType=INTEGER} + + + AND r.IS_VALID != -1 + + + AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER} + + + AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%') + + + + AND r.EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%') + + + + AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%') + + + + AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER} + + + AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER} + + + AND r.COMPILE_ID=#{compileId,jdbcType=INTEGER} + + + AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER} + + + AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%') + + + AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%') + + + AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%') + + + AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%') + + + AND r.function_id=#{functionId,jdbcType=INTEGER} + + + and r.src_ip_address =#{srcIpAddress,jdbcType=VARCHAR} + + + and r.src_port =#{srcPort,jdbcType=VARCHAR} + + + ${sqlMap.dsf} + + + + ORDER BY ${page.orderBy} + + + ORDER BY r.CFG_ID desc + + + + + + + + + SELECT LAST_INSERT_ID() + + insert into av_cont_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}, + #{ipType,jdbcType=INTEGER}, + #{srcIpAddress,jdbcType=VARCHAR}, + #{ipPattern,jdbcType=INTEGER}, + #{portPattern,jdbcType=INTEGER}, + #{srcPort,jdbcType=VARCHAR}, + #{protocol,jdbcType=INTEGER}, + #{protocolId,jdbcType=INTEGER}, + #{direction,jdbcType=INTEGER}, + #{destPort,jdbcType=VARCHAR}, + #{destIpAddress,jdbcType=VARCHAR}, + #{cfgType,jdbcType=VARCHAR}, + #{cfgRegionCode,jdbcType=INTEGER} + ) + + + + update av_cont_ip_cfg + + + + cfg_desc = #{cfgDesc,jdbcType=VARCHAR}, + + + action = #{action,jdbcType=INTEGER}, + + + is_valid = #{isValid,jdbcType=INTEGER}, + + + is_audit = #{isAudit,jdbcType=INTEGER}, + + + editor_id = #{editorId,jdbcType=INTEGER}, + + + edit_time = #{editTime,jdbcType=TIMESTAMP}, + + + AUDITOR_ID = #{auditorId,jdbcType=INTEGER}, + + + AUDIT_TIME = #{auditTime,jdbcType=TIMESTAMP}, + + + COMPILE_ID = #{compileId,jdbcType=TIMESTAMP}, + + + request_id = #{requestId,jdbcType=INTEGER}, + + + is_area_effective = #{isAreaEffective,jdbcType=INTEGER}, + + + classify = #{classify,jdbcType=VARCHAR}, + + + attribute = #{attribute,jdbcType=VARCHAR}, + + + lable = #{lable,jdbcType=VARCHAR}, + + + area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}, + + + function_id = #{functionId,jdbcType=INTEGER}, + + + service_id = #{serviceId,jdbcType=INTEGER}, + + + ip_type = #{ipType,jdbcType=INTEGER}, + + + src_ip_address = #{srcIpAddress,jdbcType=VARCHAR}, + + + ip_pattern = #{ipPattern,jdbcType=INTEGER}, + + + port_pattern = #{portPattern,jdbcType=INTEGER}, + + + src_port = #{srcPort,jdbcType=VARCHAR}, + + + protocol = #{protocol,jdbcType=INTEGER}, + + + protocol_id = #{protocolId,jdbcType=INTEGER}, + + + protocol_id = #{direction,jdbcType=INTEGER}, + + + dest_port = #{destPort,jdbcType=VARCHAR}, + + + dest_ip_address = #{destIpAddress,jdbcType=VARCHAR}, + + + cfg_type = #{cfgType,jdbcType=VARCHAR}, + + + cfg_region_code = #{cfgRegionCode,jdbcType=INTEGER}, + + + + + + and cfg_id = #{cfgId,jdbcType=INTEGER} + + + and function_id = #{functionId,jdbcType=INTEGER} + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java b/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java index b5325955e..36a1c8c6a 100644 --- a/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/AvContentCfgService.java @@ -15,25 +15,24 @@ import org.springframework.transaction.annotation.Transactional; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.nis.domain.Page; +import com.nis.domain.configuration.AreaBean; +import com.nis.domain.configuration.AreaIpCfg; +import com.nis.domain.configuration.AvContIpCfg; import com.nis.domain.configuration.AvFileSampleCfg; import com.nis.domain.configuration.AvSignSampleCfg; import com.nis.domain.configuration.AvVoipAccountCfg; import com.nis.domain.configuration.AvVoipIpCfg; import com.nis.domain.configuration.CfgIndexInfo; -import com.nis.domain.maat.ToMaatResult; import com.nis.exceptions.MaatConvertException; import com.nis.util.ConfigServiceUtil; -import com.nis.util.FileUtils; +import com.nis.util.Constants; import com.nis.util.StringUtil; -import com.nis.web.dao.FunctionRegionDictDao; -import com.nis.web.dao.FunctionServiceDictDao; -import com.nis.web.dao.configuration.AvCfgDao; +import com.nis.util.StringUtils; +import com.nis.web.dao.configuration.AreaIpCfgDao; import com.nis.web.dao.configuration.AvContentCfgDao; import com.nis.web.security.UserUtils; import com.nis.web.service.BaseService; -import com.nis.web.service.CrudService; -import net.sf.json.JSONObject; /** @@ -45,6 +44,8 @@ import net.sf.json.JSONObject; public class AvContentCfgService extends BaseService{ @Autowired protected AvContentCfgDao avContentCfgDao; + @Autowired + protected AreaIpCfgDao areaIpCfgDao; /** * 查询分页数据 @@ -100,8 +101,33 @@ public class AvContentCfgService extends BaseService{ } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public void saveOrUpdateAvVoip(CfgIndexInfo entity,String voipIpIds,String voipAccountIds){ + public void saveOrUpdateAvVoip(CfgIndexInfo entity,String voipIpIds,String voipAccountIds,String areaCfgIds){ Date createTime=new Date(); + //区域IPsetAreaEffectiveIds设置 + List areaCfg=entity.getAreaCfg(); + List 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;i0){ + entity.setAreaEffectiveIds(""); + } + } + //新增 if(entity.getCfgId()==null){ entity.setCreatorId(UserUtils.getUser().getId()); @@ -111,7 +137,7 @@ public class AvContentCfgService extends BaseService{ //调用服务接口获取compileId List compileIds = new ArrayList(); try { - //TODO 后期修改为动态获取 + //TODO //compileIds = ConfigServiceUtil.getId(1,1); compileIds.add((int)Math.floor(Math.random()*1000000+1)); } catch (Exception e) { @@ -135,12 +161,18 @@ public class AvContentCfgService extends BaseService{ avContentCfgDao.insertAvVoipAccount(entity); } } + //保存区域IP信息 + if(entity.getAreaCfg()!=null&&entity.getAreaCfg().size()>0){ + for (AreaIpCfg areaIpCfg : entity.getAreaCfg()) { + entity.setAreaIpCfg(areaIpCfg); + areaIpCfgDao.saveAreaIpCfgFromCfgIndexInfo(entity); + } + } //保存cfgIndexInfo avContentCfgDao.insertCfgIndexInfo(entity); }else{ throw new MaatConvertException(""); } - //修改 }else{ Date editTime=new Date(); @@ -149,6 +181,7 @@ public class AvContentCfgService extends BaseService{ voipIpIds=!StringUtil.isEmpty(voipIpIds)? voipIpIds+",":""; voipAccountIds=!StringUtil.isEmpty(voipAccountIds)? voipAccountIds+",":""; + areaCfgIds=!StringUtil.isEmpty(areaCfgIds)? ","+areaCfgIds:""; //判断voip信息为新增还是修改,清楚voipIpIds修改的voipId记录,剩下即为需要删除的voipId if(!StringUtil.isEmpty(entity.getVoipIps())){ @@ -192,6 +225,26 @@ public class AvContentCfgService extends BaseService{ } } } + 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); + entity.setAreaIpCfg(areaIpCfg); + areaIpCfgDao.updateAreaIpCfgFromCfgIndexInfo(entity); + }else{ + //新增 + entity.setCreatorId(UserUtils.getUser().getId()); + entity.setCreateTime(createTime); + entity.setAreaIpCfg(areaIpCfg); + areaIpCfgDao.saveAreaIpCfgFromCfgIndexInfo(entity); + } + } + } //delete 真是删除voipAccount信息 if(!StringUtil.isEmpty(voipAccountIds.replaceAll(",", ""))){ voipAccountIds=voipAccountIds.substring(1,voipAccountIds.length()); @@ -215,6 +268,18 @@ public class AvContentCfgService extends BaseService{ 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)); + cfg.setAreaIpCfg(areaIpCfg); + areaIpCfgDao.deleteAreaIpCfgByCfgId(cfg); + } + } + //修改 entity.setEditorId(UserUtils.getUser().getId()); entity.setEditTime(editTime); @@ -241,6 +306,7 @@ public class AvContentCfgService extends BaseService{ avContentCfgDao.updateAvVoipIp(entity); avContentCfgDao.updateAvVoipAccount(entity); avContentCfgDao.updateCfgIndexInfo(entity); + areaIpCfgDao.updateAreaIpCfgFromCfgIndexInfo(entity); } } /** @@ -256,6 +322,7 @@ public class AvContentCfgService extends BaseService{ List list = new ArrayList(); List voipIpList = new ArrayList(); List voipAccountList = new ArrayList(); + List areaIpCfgList = new ArrayList(); Map childMap=new HashMap<>(); CfgIndexInfo searchCfg=new CfgIndexInfo(); Date auditTime=new Date(); @@ -268,12 +335,15 @@ public class AvContentCfgService extends BaseService{ entity.setAuditTime(auditTime); voipIpList=avContentCfgDao.findVoipIpCfgList(entity); voipAccountList=avContentCfgDao.findVoipAccountCfgList(entity); + areaIpCfgList=areaIpCfgDao.findAreaIpCfgList(entity); avContentCfgDao.updateAvVoipIp(entity); avContentCfgDao.updateAvVoipAccount(entity); avContentCfgDao.updateCfgIndexInfo(entity); - childMap.put("voipIp", voipIpList); - childMap.put("voipAccount", voipAccountList); + areaIpCfgDao.updateAreaIpCfgFromCfgIndexInfo(entity); + childMap.put("voipIps", voipIpList); + childMap.put("voipAccounts", voipAccountList); + childMap.put("areaIpCfgs", areaIpCfgList); list.add(entity); } /*if(isAudit==1){ @@ -305,4 +375,66 @@ public class AvContentCfgService extends BaseService{ }*/ } + + + /** + * contIp查询分页数据 + * @param page 分页对象 + * @param entity + * @return + */ + public Page findContIpPage(Page page, AvContIpCfg entity) { + entity.getSqlMap().put("dsf", configScopeFilter(entity.getCurrentUser(),"r")); + entity.setPage(page); + List list=avContentCfgDao.findContIpList(entity); + page.setList(list); + return page; + } + + /** + * contUp根据id查询contIpCfg信息 + * @param entity + * @return + */ + public AvContIpCfg getContIpCfgById(AvContIpCfg entity) { + return avContentCfgDao.findVoipIpCfgById(entity); + } + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void saveOrUpdateAvContIp(AvContIpCfg entity){ + Date createTime=new Date(); + //新增 + if(entity.getCfgId()==null){ + entity.setCreatorId(UserUtils.getUser().getId()); + entity.setCreateTime(createTime); + entity.setIsValid(0); + entity.setIsAudit(0); + //调用服务接口获取compileId + List compileIds = new ArrayList(); + try { + //TODO + //compileIds = ConfigServiceUtil.getId(1,1); + compileIds.add((int)Math.floor(Math.random()*1000000+1)); + } catch (Exception e) { + e.printStackTrace(); + logger.info("获取编译ID出错"); + throw new MaatConvertException(":"+e.getMessage()); + } + if(compileIds != null && compileIds.size() >0 && compileIds.get(0) != 0){ + entity.setCompileId(compileIds.get(0)); + //保存cfgIndexInfo + avContentCfgDao.insertAvContIp(entity); + }else{ + throw new MaatConvertException(""); + } + + //修改 + }else{ + Date editTime=new Date(); + entity.setIsValid(0); + entity.setIsAudit(0); + entity.setEditorId(UserUtils.getUser().getId()); + entity.setEditTime(editTime); + avContentCfgDao.updateAvContIp(entity); + } + } } diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index 90a1deb3a..48fc84155 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -241,6 +241,7 @@ has_approved=It has been approved and can not be operated on ! hasnot_approved=It has not been approved and can not be operated on ! check_one=choose one please ! one_more=please choose at least one ! +one_more_area=Regional control,must full in the operator or IP information ! custom_columns=custom columns maxlength_64=The maxlength is 64! maxlength_128=The maxlength is 128! @@ -351,7 +352,7 @@ oneway=oneway twoway=twoway arbitrary=arbitrary basic_config=basic configuration -block_config=block configuration +block_config=configuration info expression_type=expression type null=null and=& diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index fb7e2abdc..94526e2ea 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -214,6 +214,7 @@ has_approved=It has been approved and can not be operated on ! hasnot_approved=It has not been approved and can not be operated on ! check_one=choose one please ! one_more=please choose at least one ! +one_more_area=Regional control,must full in the operator or IP information ! custom_columns=custom columns maxlength_64=The maxlength is 64? maxlength_128=The maxlength is 128? @@ -309,7 +310,7 @@ oneway=oneway twoway=twoway arbitrary=arbitrary basic_config=basic configuration -block_config=block configuration +block_config=configuration info expression_type=expression type null=null and=& diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index 63158a28e..6ebfb39f4 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -241,6 +241,7 @@ has_approved=\u5DF2\u7ECF\u901A\u8FC7\u5BA1\u6838\uFF0C\u65E0\u6CD5\u8FDB\u884C\ hasnot_approved=\u672A\u901A\u8FC7\u5BA1\u6838\uFF0C\u65E0\u6CD5\u8FDB\u884C\u8BE5\u64CD\u4F5C\uFF01 check_one=\u8BF7\u9009\u62E9\u4E00\u6761\u6570\u636E\uFF01 one_more=\u8BF7\u81F3\u5C11\u9009\u62E9\u4E00\u6761\u6570\u636E\! +one_more_area=\u533A\u57DF\u7BA1\u63A7\uFF0C\u5FC5\u987B\u586B\u5199\u8FD0\u8425\u5546\u6216ip\u4FE1\u606F! custom_columns=\u81EA\u5B9A\u4E49\u5217\u5B57\u6BB5 maxlength_64=\u8BF7\u8F93\u5165\u4E00\u4E2A\u957F\u5EA6\u6700\u591A\u662F 64\u7684\u5B57\u7B26\u4E32\uFF01 maxlength_128=\u8BF7\u8F93\u5165\u4E00\u4E2A\u957F\u5EA6\u6700\u591A\u662F 128\u7684\u5B57\u7B26\u4E32\uFF01 @@ -352,7 +353,7 @@ oneway=\u5355\u5411 twoway=\u53CC\u5411 arbitrary=\u4EFB\u610F basic_config=\u57FA\u672C\u914D\u7F6E -block_config=\u7BA1\u63A7\u914D\u7F6E +block_config=\u914D\u7F6E\u4FE1\u606F expression_type=\u8868\u8FBE\u5F0F\u7C7B\u578B null=\u65E0\u8868\u8FBE\u5F0F and=\u4E0E\u8868\u8FBE\u5F0F diff --git a/src/main/webapp/WEB-INF/include/form/areaInfo.jsp b/src/main/webapp/WEB-INF/include/form/areaInfo.jsp index d4047dd83..c57f03bc6 100644 --- a/src/main/webapp/WEB-INF/include/form/areaInfo.jsp +++ b/src/main/webapp/WEB-INF/include/form/areaInfo.jsp @@ -1,80 +1,10 @@ <%@ page contentType="text/html;charset=UTF-8"%> <%@ include file="/WEB-INF/include/taglib.jsp"%> -
@@ -118,7 +48,7 @@ function delAreaIsp(obj){