bgp模块ip域配置提交
导出全部数据简单功能
This commit is contained in:
@@ -3,14 +3,17 @@ package com.nis.web.controller.configuration.ntc;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
@@ -19,6 +22,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.SysUser;
|
||||
import com.nis.domain.basics.SysDictInfo;
|
||||
import com.nis.domain.configuration.AreaBean;
|
||||
import com.nis.domain.configuration.AreaIpCfg;
|
||||
@@ -29,8 +33,11 @@ import com.nis.exceptions.MaatConvertException;
|
||||
import com.nis.domain.configuration.AvVoipIpCfg;
|
||||
import com.nis.domain.configuration.BaseIpCfg;
|
||||
import com.nis.domain.configuration.BaseStringCfg;
|
||||
import com.nis.util.Configurations;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.DateUtils;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.excel.ExportExcel;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
|
||||
@@ -457,4 +464,54 @@ public class AvContentController extends BaseController {
|
||||
data.put("areaIps", areaIps);
|
||||
return data;
|
||||
}
|
||||
//视频文本VOIP配置列表导出
|
||||
@RequestMapping(value = {"/voipExport"})
|
||||
public String voipExport(Model model,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
@ModelAttribute("cfg")CfgIndexInfo entity,
|
||||
String ids,
|
||||
RedirectAttributes redirectAttributes){
|
||||
|
||||
Properties msgProp = getMsgProp();
|
||||
|
||||
try {
|
||||
String fileName = "数据-"+DateUtils.getDate("yyyyMMddHHmmss")+".xlsx";
|
||||
|
||||
//导出选中记录
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
|
||||
}else{
|
||||
//导出查询条件下的所有记录
|
||||
|
||||
if(entity.getVoipIp()== null){
|
||||
entity.setVoipIp(new AvVoipIpCfg());
|
||||
}
|
||||
if(entity.getVoipAccount()== null){
|
||||
entity.setVoipAccount(new AvVoipAccountCfg());
|
||||
}
|
||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
||||
Page pageInfo=new Page<CfgIndexInfo>(request, response,"r");
|
||||
//int pageNo=pageInfo.getPageNo();
|
||||
//int pageSize=pageInfo.getPageSize();
|
||||
if(pageInfo.getCount()>Constants.MAX_EXPORT_SIZE){
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
}else{
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(-1);
|
||||
}
|
||||
|
||||
Page<CfgIndexInfo> page = avContentCfgService.findPage(pageInfo, entity);
|
||||
new ExportExcel(msgProp,null, CfgIndexInfo.class,1).setDataList(page.getList()).write(response, fileName).dispose();
|
||||
}
|
||||
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "导出失败!失败信息:"+e.getMessage());
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/ntc/av/picUrlList?functionId="+entity.getFunctionId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
package com.nis.web.controller.configuration.ntc;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.configuration.CfgIndexInfo;
|
||||
import com.nis.domain.configuration.HttpUrlCfg;
|
||||
import com.nis.domain.configuration.IpPortCfg;
|
||||
import com.nis.exception.MaatConvertException;
|
||||
import com.nis.util.Constants;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
import com.nis.web.security.UserUtils;
|
||||
|
||||
/**
|
||||
* BGP配置
|
||||
* @author dell
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/ntc/other/")
|
||||
public class BgpCfgController extends BaseController{
|
||||
|
||||
@RequestMapping(value = {"bgpList"})
|
||||
@RequiresPermissions(value={"other:bgp:config"})
|
||||
public String httpList(Model model,@ModelAttribute("cfg")CfgIndexInfo cfg,HttpServletRequest request,HttpServletResponse response) {
|
||||
Page<CfgIndexInfo> searchPage=new Page<CfgIndexInfo>(request,response,"a");
|
||||
Page<CfgIndexInfo> page = bgpCfgService.getBgpList(searchPage, cfg);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,cfg);
|
||||
return "/cfg/other/bgpList";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@RequestMapping(value = {"bgpForm"})
|
||||
@RequiresPermissions(value={"other:bgp:config"})
|
||||
public String bgpForm(Model model,String ids,CfgIndexInfo entity) {
|
||||
if(StringUtils.isNotBlank(ids)){
|
||||
entity = bgpCfgService.getBgpCfg(Long.parseLong(ids));
|
||||
initUpdateFormCondition(model,entity);
|
||||
}else{
|
||||
initFormCondition(model,entity);
|
||||
}
|
||||
model.addAttribute("_cfg", entity);
|
||||
return "/cfg/other/bgpForm";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"saveBgpCfg"})
|
||||
@RequiresPermissions(value={"other:bgp:config"})
|
||||
public String saveBgpCfg(Model model,HttpServletRequest request,HttpServletResponse response,String ids,CfgIndexInfo entity) {
|
||||
bgpCfgService.saveBgpCfg(entity);
|
||||
return "redirect:" + adminPath +"/ntc/other/bgpList?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"ajaxBgpSubList"})
|
||||
public String ajaxBgpSubList(Model model,Long cfgId,Integer index) {
|
||||
CfgIndexInfo cfg = bgpCfgService.getBgpCfg(cfgId);
|
||||
List<String[]> tabList = new ArrayList();
|
||||
if(cfg.getIpPortList()!=null){
|
||||
String cfgType = null;
|
||||
for(IpPortCfg ip:cfg.getIpPortList()){
|
||||
if(!ip.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"1",ip.getCfgType()});
|
||||
cfgType = ip.getCfgType();
|
||||
}
|
||||
}
|
||||
}
|
||||
/*TODO
|
||||
* if(cfg.getDomainList()!=null){
|
||||
String cfgType = null;
|
||||
for(ComplexkeywordCfg keyword:cfg.getDomainList()){
|
||||
if(!keyword.getCfgType().equals(cfgType)){
|
||||
tabList.add(new String[]{"3",keyword.getCfgType()});
|
||||
cfgType = keyword.getCfgType();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
model.addAttribute("_cfg", cfg);
|
||||
model.addAttribute("index", index);
|
||||
model.addAttribute("tabList", tabList);
|
||||
return "/cfg/website/dnsSubList";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"updateBgpCfgValid"})
|
||||
@RequiresPermissions(value={"other:bgp:config"})
|
||||
public String updateBgpCfgValid(Integer isValid,String ids,Integer functionId) {
|
||||
bgpCfgService.updateBgpCfgValid(isValid,ids,functionId);
|
||||
return "redirect:" + adminPath +"/ntc/other/bgpList?functionId="+functionId;
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"auditBgpCfg"})
|
||||
@RequiresPermissions(value={"other:bgp:audit"})
|
||||
public String auditBgpCfg(Integer isAudit,Integer isValid,String ids,Integer functionId, RedirectAttributes redirectAttributes) {
|
||||
CfgIndexInfo entity = new CfgIndexInfo();
|
||||
String[] idArray = ids.split(",");
|
||||
for(String id :idArray){
|
||||
entity = bgpCfgService.getBgpCfg(Long.parseLong(id));
|
||||
entity.setIsAudit(isAudit);
|
||||
entity.setIsValid(isValid);
|
||||
entity.setAuditorId(UserUtils.getUser().getId());
|
||||
entity.setAuditTime(new Date());
|
||||
entity.setFunctionId(functionId);
|
||||
try {
|
||||
bgpCfgService.auditBgpCfg(entity,isAudit);
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("bgp配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes, e.getMessage());
|
||||
}
|
||||
}
|
||||
return "redirect:" + adminPath +"/ntc/other/bgpList?functionId="+functionId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user