业务配置导出首行增加标题和时间范围
This commit is contained in:
@@ -42,211 +42,231 @@ import com.nis.web.service.configuration.DnsIpCfgService;
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/cfg/dnsIp")
|
||||
public class DnsIpCfgController extends BaseController {
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,@ModelAttribute("cfg")DnsIpCfg entity
|
||||
,RedirectAttributes redirectAttributes){
|
||||
Page<DnsIpCfg> page = dnsIpCfgService.findPage(new Page<DnsIpCfg>(request, response,"r"), entity);
|
||||
|
||||
@RequestMapping(value = { "/list" })
|
||||
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") DnsIpCfg entity, RedirectAttributes redirectAttributes) {
|
||||
Page<DnsIpCfg> page = dnsIpCfgService.findPage(new Page<DnsIpCfg>(request, response, "r"), entity);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,entity);
|
||||
initPageCondition(model, entity);
|
||||
return "/cfg/dnsIpCfgList";
|
||||
}
|
||||
@RequestMapping(value = {"/form"})
|
||||
@RequiresPermissions(value={"dns:fake:ip:config"})
|
||||
public String form(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,String ids,@ModelAttribute("cfg")DnsIpCfg cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
|
||||
@RequestMapping(value = { "/form" })
|
||||
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
||||
public String form(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||
@ModelAttribute("cfg") DnsIpCfg cfg, RedirectAttributes redirectAttributes) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
cfg = dnsIpCfgService.getDnsIpCfg(Long.parseLong(ids));
|
||||
initUpdateFormCondition(model, cfg);
|
||||
}else{
|
||||
initFormCondition(model,cfg);
|
||||
} else {
|
||||
initFormCondition(model, cfg);
|
||||
}
|
||||
/*//获取所有响应策略信息
|
||||
List<DnsResStrategy> resStrategys=dnsResStrategyService.findDnsResStrategys(null, 1,1);
|
||||
model.addAttribute("dnsResStrategys", resStrategys);*/
|
||||
//查询policyGroup列表,供响应策略选择 2018-07-24 经确定IP欺骗只能选择非0号分组
|
||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(1);
|
||||
/*
|
||||
* //获取所有响应策略信息 List<DnsResStrategy>
|
||||
* resStrategys=dnsResStrategyService.findDnsResStrategys(null, 1,1);
|
||||
* model.addAttribute("dnsResStrategys", resStrategys);
|
||||
*/
|
||||
// 查询policyGroup列表,供响应策略选择 2018-07-24 经确定IP欺骗只能选择非0号分组
|
||||
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findPolicyGroupInfosByType(1);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/cfg/dnsIpCfgForm";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化一条dns fakeip配置
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"initSpoofingIp"})
|
||||
public String initSpoofingIp(){
|
||||
Properties msg=getMsgProp();
|
||||
@RequestMapping(value = { "initSpoofingIp" })
|
||||
public String initSpoofingIp() {
|
||||
Properties msg = getMsgProp();
|
||||
try {
|
||||
DnsIpCfg entity=new DnsIpCfg();
|
||||
DnsIpCfg entity = new DnsIpCfg();
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
entity.setDnsStrategyId(0);
|
||||
List<DnsIpCfg> list=dnsIpCfgService.findDnsIpCfg(entity);
|
||||
if(StringUtil.isEmpty(list)) {
|
||||
List<DnsIpCfg> list = dnsIpCfgService.findDnsIpCfg(entity);
|
||||
if (StringUtil.isEmpty(list)) {
|
||||
dnsIpCfgService.saveAndAudit();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("初始化Spoofing ip失败",e);
|
||||
logger.error("初始化Spoofing ip失败", e);
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
if (e instanceof MaatConvertException) {
|
||||
return msg.getProperty("request_service_failed");
|
||||
}else {
|
||||
} else {
|
||||
return msg.getProperty("save_failed");
|
||||
}
|
||||
}
|
||||
return "success";
|
||||
}
|
||||
@RequestMapping(value = {"/saveOrUpdate"})
|
||||
@RequiresPermissions(value={"dns:fake:ip:config"})
|
||||
public String saveOrUpdate(Model model,HttpServletRequest request
|
||||
,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")DnsIpCfg cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
|
||||
@RequestMapping(value = { "/saveOrUpdate" })
|
||||
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
||||
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") DnsIpCfg cfg, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
dnsIpCfgService.saveOrUpdate(cfg);
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
logger.error("信息保存失败",e);
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("信息保存失败", e);
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error","save_failed");
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/cfg/dnsIp/list?functionId="+cfg.getFunctionId();
|
||||
|
||||
return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/delete"})
|
||||
@RequiresPermissions(value={"dns:fake:ip:config"})
|
||||
public String delete(Integer isAudit,Integer isValid
|
||||
,String ids,Integer functionId
|
||||
,RedirectAttributes redirectAttributes){
|
||||
dnsIpCfgService.delete(isAudit,isValid,ids,functionId);
|
||||
return "redirect:" + adminPath +"/cfg/dnsIp/list?functionId="+functionId;
|
||||
|
||||
@RequestMapping(value = { "/delete" })
|
||||
@RequiresPermissions(value = { "dns:fake:ip:config" })
|
||||
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
dnsIpCfgService.delete(isAudit, isValid, ids, functionId);
|
||||
return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + functionId;
|
||||
}
|
||||
@RequestMapping(value = {"/audit"})
|
||||
@RequiresPermissions(value={"dns:fake:ip:confirm"})
|
||||
public String audit(Model model,@ModelAttribute("cfg")DnsIpCfg cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
|
||||
@RequestMapping(value = { "/audit" })
|
||||
@RequiresPermissions(value = { "dns:fake:ip:confirm" })
|
||||
public String audit(Model model, @ModelAttribute("cfg") DnsIpCfg cfg, Integer isValid, Integer isAudit, String ids,
|
||||
Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
String[] idArray = ids.split(",");
|
||||
Date auditTime=new Date();
|
||||
for(String id :idArray){
|
||||
Date auditTime = new Date();
|
||||
for (String id : idArray) {
|
||||
try {
|
||||
dnsIpCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
dnsIpCfgService.audit(isAudit, isValid, functionId, id, auditTime);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("dns fake ip配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error","request_service_failed");
|
||||
logger.info("dns fake ip配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("dns fake ip配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.info("dns fake ip配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}else {
|
||||
Page<DnsIpCfg> searchPage=new Page<DnsIpCfg>(request,response,"r");
|
||||
Page<DnsIpCfg> auditPage=new Page<DnsIpCfg>(request,response,"r");
|
||||
|
||||
} else {
|
||||
Page<DnsIpCfg> searchPage = new Page<DnsIpCfg>(request, response, "r");
|
||||
Page<DnsIpCfg> auditPage = new Page<DnsIpCfg>(request, response, "r");
|
||||
|
||||
try {
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
auditAll(auditPage, isValid, cfg);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("配置下发失败:", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return list(model, request, response,cfg, redirectAttributes);
|
||||
|
||||
return list(model, request, response, cfg, redirectAttributes);
|
||||
}
|
||||
return "redirect:" + adminPath +"/cfg/dnsIp/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/cfg/dnsIp/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* DNS阻断无策略时检验
|
||||
*
|
||||
* @param entity
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"/dnsNoStrategyCheck"})
|
||||
public boolean dnsNoStrategyCheck(DnsIpCfg entity, HttpServletRequest request, HttpServletResponse response){
|
||||
@RequestMapping(value = { "/dnsNoStrategyCheck" })
|
||||
public boolean dnsNoStrategyCheck(DnsIpCfg entity, HttpServletRequest request, HttpServletResponse response) {
|
||||
entity.setIsAudit(1);
|
||||
entity.setIsValid(1);
|
||||
List<DnsIpCfg> list = dnsIpCfgService.findDnsIpCfg(entity);
|
||||
if(list.size() > 0){
|
||||
if (list.size() > 0) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//dnsIp配置导出
|
||||
@RequestMapping(value = "exportDnsIp")
|
||||
public void exportDns(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")DnsIpCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
|
||||
List<DnsIpCfg> ipLists=new ArrayList<DnsIpCfg>();
|
||||
//导出选中记录
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipLists=dnsIpCfgService.findByPage(ids);
|
||||
}else{
|
||||
Page<DnsIpCfg> pageInfo=new Page<DnsIpCfg>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<DnsIpCfg> page = dnsIpCfgService.findPage(pageInfo, entity);
|
||||
ipLists=page.getList();
|
||||
}
|
||||
|
||||
for (int i = 0; i < ipLists.size(); i++) {
|
||||
if(StringUtil.isEmpty(ipLists.get(i).getDnsStrategyName())){
|
||||
Properties msgProp = getMsgProp();
|
||||
ipLists.get(i).setDnsStrategyName(msgProp.getProperty("default_group"));
|
||||
}
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), DnsIpCfg.class);
|
||||
String cfgIndexInfoNoExport=",whether_area_block,client_ip,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("DnsIp export failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "export_failed");
|
||||
// dnsIp配置导出
|
||||
@RequestMapping(value = "exportDnsIp")
|
||||
public void exportDns(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") DnsIpCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
|
||||
List<DnsIpCfg> ipLists = new ArrayList<DnsIpCfg>();
|
||||
// 导出选中记录
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipLists = dnsIpCfgService.findByPage(ids);
|
||||
} else {
|
||||
Page<DnsIpCfg> pageInfo = new Page<DnsIpCfg>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<DnsIpCfg> page = dnsIpCfgService.findPage(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
for (int i = 0; i < ipLists.size(); i++) {
|
||||
if (StringUtil.isEmpty(ipLists.get(i).getDnsStrategyName())) {
|
||||
Properties msgProp = getMsgProp();
|
||||
ipLists.get(i).setDnsStrategyName(msgProp.getProperty("default_group"));
|
||||
}
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), DnsIpCfg.class);
|
||||
String cfgIndexInfoNoExport = ",whether_area_block,client_ip,port_pattern,client_port,server_port,ir_type,direction,protocol,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("DnsIp export failed", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
}
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,189 +33,206 @@ import com.nis.web.controller.BaseController;
|
||||
|
||||
/**
|
||||
* dns响应策略
|
||||
*
|
||||
* @author ddm
|
||||
*
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/maintenance/dnsResStrategy")
|
||||
public class DnsResStrategyController extends BaseController {
|
||||
|
||||
@RequestMapping(value = {"/form"})
|
||||
@RequiresPermissions(value={"dns:res:strategy:config"})
|
||||
public String from(Model model,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
String ids,
|
||||
@ModelAttribute("cfg")DnsResStrategy cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
if(cfg == null){
|
||||
cfg=new DnsResStrategy();
|
||||
public class DnsResStrategyController extends BaseController {
|
||||
|
||||
@RequestMapping(value = { "/form" })
|
||||
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
||||
public String from(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||
@ModelAttribute("cfg") DnsResStrategy cfg, RedirectAttributes redirectAttributes) {
|
||||
if (cfg == null) {
|
||||
cfg = new DnsResStrategy();
|
||||
}
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
cfg = dnsResStrategyService.getDnsResStrategy(Long.valueOf(ids),-1);
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
cfg = dnsResStrategyService.getDnsResStrategy(Long.valueOf(ids), -1);
|
||||
initFormCondition(model, cfg);
|
||||
model.addAttribute("isAdd", false);
|
||||
}else{
|
||||
/*//不存在响应策略为0的配置,则新策略时,cfgId默认为0
|
||||
DnsResStrategy dns0=dnsResStrategyService.getDnsResStrategy(0l,null);
|
||||
if(dns0 == null){
|
||||
cfg.setCfgId(0l);
|
||||
cfg.setCfgDesc("无策略");
|
||||
}*/
|
||||
} else {
|
||||
/*
|
||||
* //不存在响应策略为0的配置,则新策略时,cfgId默认为0 DnsResStrategy
|
||||
* dns0=dnsResStrategyService.getDnsResStrategy(0l,null); if(dns0 ==
|
||||
* null){ cfg.setCfgId(0l); cfg.setCfgDesc("无策略"); }
|
||||
*/
|
||||
initFormCondition(model, cfg);
|
||||
model.addAttribute("isAdd", true);
|
||||
}
|
||||
|
||||
//查询policyGroup列表,供响应策略选择
|
||||
// List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(1);
|
||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.findHasIpPolicyGroupInfosByType(1);
|
||||
|
||||
// 查询policyGroup列表,供响应策略选择
|
||||
// List<PolicyGroupInfo>
|
||||
// policyGroups=policyGroupInfoService.findPolicyGroupInfosByType(1);
|
||||
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.findHasIpPolicyGroupInfosByType(1);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
|
||||
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/cfg/maintenance/dnsResStrategy/form";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/saveOrUpdate"})
|
||||
@RequiresPermissions(value={"dns:res:strategy:config"})
|
||||
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")DnsResStrategy cfg
|
||||
,RedirectAttributes redirectAttributes){
|
||||
try{
|
||||
|
||||
|
||||
@RequestMapping(value = { "/saveOrUpdate" })
|
||||
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
||||
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") DnsResStrategy cfg, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
|
||||
dnsResStrategyService.saveOrUpdate(cfg);
|
||||
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch (MaatConvertException e) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (MaatConvertException e) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} catch (Exception e) {
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/maintenance/dnsResStrategy/list?functionId="+cfg.getFunctionId();
|
||||
|
||||
return "redirect:" + adminPath + "/maintenance/dnsResStrategy/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response
|
||||
,@ModelAttribute("cfg")DnsResStrategy entity
|
||||
,RedirectAttributes redirectAttributes){
|
||||
//查询时left join policyGroup
|
||||
Page<DnsResStrategy> page = dnsResStrategyService.findPage(new Page<DnsResStrategy>(request, response,"r"), entity);
|
||||
|
||||
@RequestMapping(value = { "/list" })
|
||||
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") DnsResStrategy entity, RedirectAttributes redirectAttributes) {
|
||||
// 查询时left join policyGroup
|
||||
Page<DnsResStrategy> page = dnsResStrategyService.findPage(new Page<DnsResStrategy>(request, response, "r"),
|
||||
entity);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,entity);
|
||||
initPageCondition(model, entity);
|
||||
return "/cfg/maintenance/dnsResStrategy/list";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/delete"})
|
||||
@RequiresPermissions(value={"dns:res:strategy:config"})
|
||||
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId
|
||||
,Model model,HttpServletRequest request
|
||||
,HttpServletResponse response
|
||||
,RedirectAttributes redirectAttributes){
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
dnsResStrategyService.delete(isAudit,isValid,ids,functionId);
|
||||
|
||||
@RequestMapping(value = { "/delete" })
|
||||
@RequiresPermissions(value = { "dns:res:strategy:config" })
|
||||
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
|
||||
HttpServletRequest request, HttpServletResponse response, RedirectAttributes redirectAttributes) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
dnsResStrategyService.delete(isAudit, isValid, ids, functionId);
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/maintenance/dnsResStrategy/list?functionId="+functionId;
|
||||
|
||||
return "redirect:" + adminPath + "/maintenance/dnsResStrategy/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/audit"})
|
||||
@RequiresPermissions(value={"dns:res:strategy:confirm"})
|
||||
public String audit(Model model,@ModelAttribute("cfg")DnsResStrategy cfg,
|
||||
Integer isValid,
|
||||
Integer isAudit,
|
||||
String ids,
|
||||
Integer functionId,
|
||||
RedirectAttributes redirectAttributes,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
|
||||
@RequestMapping(value = { "/audit" })
|
||||
@RequiresPermissions(value = { "dns:res:strategy:confirm" })
|
||||
public String audit(Model model, @ModelAttribute("cfg") DnsResStrategy cfg, Integer isValid, Integer isAudit,
|
||||
String ids, Integer functionId, RedirectAttributes redirectAttributes, HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
String[] idArray = ids.split(",");
|
||||
Date auditTime=new Date();
|
||||
for(String id :idArray){
|
||||
Date auditTime = new Date();
|
||||
for (String id : idArray) {
|
||||
try {
|
||||
dnsResStrategyService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
dnsResStrategyService.audit(isAudit, isValid, functionId, id, auditTime);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} catch (Exception e) {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
}
|
||||
|
||||
}else {
|
||||
Page<DnsResStrategy> searchPage=new Page<DnsResStrategy>(request,response,"r");
|
||||
Page<DnsResStrategy> auditPage=new Page<DnsResStrategy>(request,response,"r");
|
||||
|
||||
} else {
|
||||
Page<DnsResStrategy> searchPage = new Page<DnsResStrategy>(request, response, "r");
|
||||
Page<DnsResStrategy> auditPage = new Page<DnsResStrategy>(request, response, "r");
|
||||
|
||||
try {
|
||||
BeanUtils.copyProperties(searchPage, auditPage);
|
||||
auditAll(auditPage,isValid , cfg);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
auditAll(auditPage, isValid, cfg);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (Exception e) {
|
||||
logger.error("配置下发失败:",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.error("配置下发失败:", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return list(model, request, response, cfg,redirectAttributes);
|
||||
|
||||
return list(model, request, response, cfg, redirectAttributes);
|
||||
}
|
||||
return "redirect:" + adminPath +"/maintenance/dnsResStrategy/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/maintenance/dnsResStrategy/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "/validCfgId")
|
||||
public boolean validCfgId(Long cfgId) {
|
||||
DnsResStrategy dns=dnsResStrategyService.getDnsResStrategy(cfgId,null);
|
||||
if(dns == null ){
|
||||
DnsResStrategy dns = dnsResStrategyService.getDnsResStrategy(cfgId, null);
|
||||
if (dns == null) {
|
||||
return false;
|
||||
}else{
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
//dns配置导出
|
||||
|
||||
// dns配置导出
|
||||
@RequestMapping(value = "exportDns")
|
||||
public void exportDns(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")DnsResStrategy entity,String ids,RedirectAttributes redirectAttributes){
|
||||
public void exportDns(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") DnsResStrategy entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
List<DnsResStrategy> ipLists=new ArrayList<DnsResStrategy>();
|
||||
//导出选中记录
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipLists=dnsResStrategyService.findByPage(ids);
|
||||
}else{
|
||||
Page<DnsResStrategy> pageInfo=new Page<DnsResStrategy>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<DnsResStrategy> page = dnsResStrategyService.findPage(pageInfo, entity);
|
||||
ipLists=page.getList();
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
List<DnsResStrategy> ipLists = new ArrayList<DnsResStrategy>();
|
||||
// 导出选中记录
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipLists = dnsResStrategyService.findByPage(ids);
|
||||
} else {
|
||||
Page<DnsResStrategy> pageInfo = new Page<DnsResStrategy>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<DnsResStrategy> page = dnsResStrategyService.findPage(pageInfo, entity);
|
||||
ipLists = page.getList();
|
||||
}
|
||||
|
||||
for (int i = 0; i < ipLists.size(); i++) {
|
||||
ipLists.get(i).setMiTtlmax(
|
||||
String.valueOf(ipLists.get(i).getMinTtl()) + "-" + String.valueOf(ipLists.get(i).getMaxTtl()));
|
||||
ipLists.get(i).setDnsId(String.valueOf(ipLists.get(i).getCfgId()));
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), DnsResStrategy.class);
|
||||
String cfgIndexInfoNoExport = ",cfg_id,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,&config_describe:policy_name-";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",config_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",edit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
cfgIndexInfoNoExport = ",audit_time" + cfgIndexInfoNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
if (entity.gethColumns().contains("policy_name")) {
|
||||
cfgIndexInfoNoExport = ",config_describe," + cfgIndexInfoNoExport;
|
||||
}
|
||||
|
||||
for (int i = 0; i < ipLists.size(); i++) {
|
||||
ipLists.get(i).setMiTtlmax(String.valueOf(ipLists.get(i).getMinTtl())+"-"+String.valueOf(ipLists.get(i).getMaxTtl()));
|
||||
ipLists.get(i).setDnsId( String.valueOf(ipLists.get(i).getCfgId()));
|
||||
}
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), DnsResStrategy.class);
|
||||
String cfgIndexInfoNoExport=",cfg_id,valid_identifier,do_log,client_port,ir_type,group_name,userregion1,userregion2,userregion3,userregion4,userregion5,";
|
||||
noExportMap.put(entity.getMenuNameCode(),cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(),ipLists);
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
cfgIndexInfoNoExport = "," + entity.gethColumns() + "," + cfgIndexInfoNoExport;
|
||||
}
|
||||
noExportMap.put(entity.getMenuNameCode(), cfgIndexInfoNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), ipLists);
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Dns export failed",e);
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "export_failed");
|
||||
logger.error("Dns export failed", e);
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,213 +34,200 @@ import com.nis.web.service.basics.SysDictInfoService;
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("${adminPath}/maintenance/ipMultiplexPoolCfg")
|
||||
public class IpMultiplexPoolCfgController extends BaseController {
|
||||
|
||||
@RequestMapping(value = {"/form"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||
public String from(Model model,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
String ids,
|
||||
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
|
||||
if(cfg == null){
|
||||
cfg=new IpMultiplexPoolCfg();
|
||||
public class IpMultiplexPoolCfgController extends BaseController {
|
||||
|
||||
@RequestMapping(value = { "/form" })
|
||||
@RequiresPermissions(value = { "ip:mulitiplex:pool:config" })
|
||||
public String from(Model model, HttpServletRequest request, HttpServletResponse response, String ids,
|
||||
@ModelAttribute("cfg") IpMultiplexPoolCfg cfg) {
|
||||
if (cfg == null) {
|
||||
cfg = new IpMultiplexPoolCfg();
|
||||
}
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
cfg = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids),null);
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
cfg = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids), null);
|
||||
initFormCondition(model, cfg);
|
||||
}else{
|
||||
} else {
|
||||
initFormCondition(model, cfg);
|
||||
}
|
||||
|
||||
//查询ip复用地址池配置的policyGroup列表
|
||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.getHasAreaPolicyGroups(3);
|
||||
|
||||
// 查询ip复用地址池配置的policyGroup列表
|
||||
List<PolicyGroupInfo> policyGroups = policyGroupInfoService.getHasAreaPolicyGroups(3);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/cfg/maintenance/ipMultiplexPool/form";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/saveOrUpdate"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||
public String saveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
||||
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
|
||||
try{
|
||||
|
||||
@RequestMapping(value = { "/saveOrUpdate" })
|
||||
@RequiresPermissions(value = { "ip:mulitiplex:pool:config" })
|
||||
public String saveOrUpdate(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
RedirectAttributes redirectAttributes, @ModelAttribute("cfg") IpMultiplexPoolCfg cfg) {
|
||||
try {
|
||||
// 设置省份信息
|
||||
groupAreaService.setAreaCodeByGroupId(cfg);
|
||||
|
||||
|
||||
ipMultiplexPoolCfgService.saveOrUpdate(cfg);
|
||||
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
|
||||
addMessage(redirectAttributes, "success", "save_success");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
if (e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} else {
|
||||
addMessage(redirectAttributes, "error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+cfg.getFunctionId();
|
||||
|
||||
return "redirect:" + adminPath + "/maintenance/ipMultiplexPoolCfg/list?functionId=" + cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/list"})
|
||||
public String list(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){
|
||||
//查询时left join policyGroup
|
||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(new Page<IpMultiplexPoolCfg>(request, response,"r"), entity);
|
||||
|
||||
@RequestMapping(value = { "/list" })
|
||||
public String list(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") IpMultiplexPoolCfg entity) {
|
||||
// 查询时left join policyGroup
|
||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService
|
||||
.findPage(new Page<IpMultiplexPoolCfg>(request, response, "r"), entity);
|
||||
model.addAttribute("page", page);
|
||||
initPageCondition(model,entity);
|
||||
initPageCondition(model, entity);
|
||||
return "/cfg/maintenance/ipMultiplexPool/list";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/delete"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||
public String delete(Integer isAudit,Integer isValid,String ids,Integer functionId,Model model,RedirectAttributes redirectAttributes
|
||||
,HttpServletRequest request,HttpServletResponse response){
|
||||
try{
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipMultiplexPoolCfgService.delete(isAudit,isValid,ids,functionId);
|
||||
|
||||
@RequestMapping(value = { "/delete" })
|
||||
@RequiresPermissions(value = { "ip:mulitiplex:pool:config" })
|
||||
public String delete(Integer isAudit, Integer isValid, String ids, Integer functionId, Model model,
|
||||
RedirectAttributes redirectAttributes, HttpServletRequest request, HttpServletResponse response) {
|
||||
try {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
ipMultiplexPoolCfgService.delete(isAudit, isValid, ids, functionId);
|
||||
}
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error(e);
|
||||
addMessage(redirectAttributes,"error", "delete_failed");
|
||||
addMessage(redirectAttributes, "success", "delete_success");
|
||||
} catch (Exception e) {
|
||||
logger.error(e);
|
||||
addMessage(redirectAttributes, "error", "delete_failed");
|
||||
}
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/maintenance/ipMultiplexPoolCfg/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/audit"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:confirm"})
|
||||
public String audit(Integer isAudit,Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
|
||||
@RequestMapping(value = { "/audit" })
|
||||
@RequiresPermissions(value = { "ip:mulitiplex:pool:confirm" })
|
||||
public String audit(Integer isAudit, Integer isValid, String ids, Integer functionId,
|
||||
RedirectAttributes redirectAttributes) {
|
||||
if (!StringUtil.isEmpty(ids)) {
|
||||
String[] idArray = ids.split(",");
|
||||
Date auditTime=new Date();
|
||||
for(String id :idArray){
|
||||
Date auditTime = new Date();
|
||||
for (String id : idArray) {
|
||||
try {
|
||||
ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
addMessage(redirectAttributes,"success", "audit_success");
|
||||
ipMultiplexPoolCfgService.audit(isAudit, isValid, functionId, id, auditTime);
|
||||
addMessage(redirectAttributes, "success", "audit_success");
|
||||
} catch (MaatConvertException e) {
|
||||
e.printStackTrace();
|
||||
logger.info("IP复用地址池配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}catch (Exception e) {
|
||||
logger.info("IP复用地址池配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "request_service_failed");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.info("IP复用地址池配置下发失败:"+e.getMessage());
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
logger.info("IP复用地址池配置下发失败:" + e.getMessage());
|
||||
addMessage(redirectAttributes, "error", "audit_failed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/list?functionId="+functionId;
|
||||
return "redirect:" + adminPath + "/maintenance/ipMultiplexPoolCfg/list?functionId=" + functionId;
|
||||
}
|
||||
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "/validCfgId")
|
||||
public boolean validCfgId(Long cfgId) {
|
||||
IpMultiplexPoolCfg dns=ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(cfgId,null);
|
||||
if(dns == null ){
|
||||
IpMultiplexPoolCfg dns = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(cfgId, null);
|
||||
if (dns == null) {
|
||||
return false;
|
||||
}else{
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/*@RequestMapping(value = {"/snatlist"})
|
||||
public String snatlist(Model model,HttpServletRequest request,HttpServletResponse response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){
|
||||
//查询时left join policyGroup
|
||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(new Page<IpMultiplexPoolCfg>(request, response,"r"), entity);
|
||||
model.addAttribute("page", page);
|
||||
initFormCondition(model,entity);
|
||||
return "/cfg/maintenance/ipMultiplexPool/snatlist";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/snatform"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||
public String snatfrom(Model model,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response,
|
||||
String ids,
|
||||
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
|
||||
if(cfg == null){
|
||||
cfg=new IpMultiplexPoolCfg();
|
||||
}
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
cfg = ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids),null);
|
||||
initUpdateFormCondition(model, cfg);
|
||||
}else{
|
||||
initFormCondition(model, cfg);
|
||||
}
|
||||
|
||||
//查询ip复用地址池配置的policyGroup列表
|
||||
List<PolicyGroupInfo> policyGroups=policyGroupInfoService.getHasAreaPolicyGroups(2);
|
||||
model.addAttribute("policyGroups", policyGroups);
|
||||
model.addAttribute("_cfg", cfg);
|
||||
return "/cfg/maintenance/ipMultiplexPool/snatform";
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/snatsaveOrUpdate"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||
public String snatsaveOrUpdate(Model model,HttpServletRequest request,HttpServletResponse response,RedirectAttributes redirectAttributes,
|
||||
@ModelAttribute("cfg")IpMultiplexPoolCfg cfg){
|
||||
try{
|
||||
// 设置省份信息
|
||||
if(!StringUtil.isEmpty(cfg.getPolicyGroup())){
|
||||
groupAreaService.setAreaCodeByGroupId(cfg);
|
||||
}
|
||||
ipMultiplexPoolCfgService.saveOrUpdate(cfg);
|
||||
|
||||
addMessage(redirectAttributes,"success","save_success");
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "save_failed");
|
||||
}
|
||||
}
|
||||
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+cfg.getFunctionId();
|
||||
}
|
||||
|
||||
@RequestMapping(value = {"/snataudit"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:confirm"})
|
||||
public String snataudit(Integer isAudit,Integer isValid,String ids,Integer functionId,RedirectAttributes redirectAttributes) {
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
String[] idArray = ids.split(",");
|
||||
Date auditTime=new Date();
|
||||
for(String id :idArray){
|
||||
try {
|
||||
ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
logger.error("SNAT地址池管理配置下发失败:"+e.getMessage());
|
||||
if(e instanceof MaatConvertException) {
|
||||
addMessage(redirectAttributes,"error", "request_service_failed");
|
||||
}else {
|
||||
addMessage(redirectAttributes,"error", "audit_failed");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId;
|
||||
}
|
||||
@RequestMapping(value = {"/snatdelete"})
|
||||
@RequiresPermissions(value={"ip:mulitiplex:pool:config"})
|
||||
public String snatdelete(Integer isAudit,Integer isValid,String ids,Integer functionId,Model model,RedirectAttributes redirectAttributes
|
||||
,HttpServletRequest request,HttpServletResponse response){
|
||||
try{
|
||||
if(!StringUtil.isEmpty(ids)){
|
||||
ipMultiplexPoolCfgService.delete(isAudit,isValid,ids,functionId);
|
||||
}
|
||||
addMessage(redirectAttributes,"success","delete_success");
|
||||
}catch(Exception e){
|
||||
logger.error(e);
|
||||
addMessage(redirectAttributes,"error","delete_failed");
|
||||
}
|
||||
return "redirect:" + adminPath +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId;
|
||||
}*/
|
||||
|
||||
|
||||
/*
|
||||
* @RequestMapping(value = {"/snatlist"}) public String snatlist(Model
|
||||
* model,HttpServletRequest request,HttpServletResponse
|
||||
* response,@ModelAttribute("cfg")IpMultiplexPoolCfg entity){ //查询时left join
|
||||
* policyGroup Page<IpMultiplexPoolCfg> page =
|
||||
* ipMultiplexPoolCfgService.findPage(new Page<IpMultiplexPoolCfg>(request,
|
||||
* response,"r"), entity); model.addAttribute("page", page);
|
||||
* initFormCondition(model,entity); return
|
||||
* "/cfg/maintenance/ipMultiplexPool/snatlist"; }
|
||||
*
|
||||
* @RequestMapping(value = {"/snatform"})
|
||||
*
|
||||
* @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) public String
|
||||
* snatfrom(Model model, HttpServletRequest request, HttpServletResponse
|
||||
* response, String ids,
|
||||
*
|
||||
* @ModelAttribute("cfg")IpMultiplexPoolCfg cfg){ if(cfg == null){ cfg=new
|
||||
* IpMultiplexPoolCfg(); } if(!StringUtil.isEmpty(ids)){ cfg =
|
||||
* ipMultiplexPoolCfgService.getIpMultiplexPoolCfg(Long.valueOf(ids),null);
|
||||
* initUpdateFormCondition(model, cfg); }else{ initFormCondition(model,
|
||||
* cfg); }
|
||||
*
|
||||
* //查询ip复用地址池配置的policyGroup列表 List<PolicyGroupInfo>
|
||||
* policyGroups=policyGroupInfoService.getHasAreaPolicyGroups(2);
|
||||
* model.addAttribute("policyGroups", policyGroups);
|
||||
* model.addAttribute("_cfg", cfg); return
|
||||
* "/cfg/maintenance/ipMultiplexPool/snatform"; }
|
||||
*
|
||||
* @RequestMapping(value = {"/snatsaveOrUpdate"})
|
||||
*
|
||||
* @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) public String
|
||||
* snatsaveOrUpdate(Model model,HttpServletRequest
|
||||
* request,HttpServletResponse response,RedirectAttributes
|
||||
* redirectAttributes,
|
||||
*
|
||||
* @ModelAttribute("cfg")IpMultiplexPoolCfg cfg){ try{ // 设置省份信息
|
||||
* if(!StringUtil.isEmpty(cfg.getPolicyGroup())){
|
||||
* groupAreaService.setAreaCodeByGroupId(cfg); }
|
||||
* ipMultiplexPoolCfgService.saveOrUpdate(cfg);
|
||||
*
|
||||
* addMessage(redirectAttributes,"success","save_success"); }catch(Exception
|
||||
* e){ e.printStackTrace(); if(e instanceof MaatConvertException) {
|
||||
* addMessage(redirectAttributes,"error", "request_service_failed"); }else {
|
||||
* addMessage(redirectAttributes,"error", "save_failed"); } }
|
||||
*
|
||||
* return "redirect:" + adminPath
|
||||
* +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+cfg.getFunctionId
|
||||
* (); }
|
||||
*
|
||||
* @RequestMapping(value = {"/snataudit"})
|
||||
*
|
||||
* @RequiresPermissions(value={"ip:mulitiplex:pool:confirm"}) public String
|
||||
* snataudit(Integer isAudit,Integer isValid,String ids,Integer
|
||||
* functionId,RedirectAttributes redirectAttributes) {
|
||||
* if(!StringUtil.isEmpty(ids)){ String[] idArray = ids.split(","); Date
|
||||
* auditTime=new Date(); for(String id :idArray){ try {
|
||||
* ipMultiplexPoolCfgService.audit(isAudit,isValid,functionId,id,auditTime);
|
||||
* } catch (Exception e) { e.printStackTrace();
|
||||
* logger.error("SNAT地址池管理配置下发失败:"+e.getMessage()); if(e instanceof
|
||||
* MaatConvertException) { addMessage(redirectAttributes,"error",
|
||||
* "request_service_failed"); }else { addMessage(redirectAttributes,"error",
|
||||
* "audit_failed"); } } }
|
||||
*
|
||||
* } return "redirect:" + adminPath
|
||||
* +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId; }
|
||||
*
|
||||
* @RequestMapping(value = {"/snatdelete"})
|
||||
*
|
||||
* @RequiresPermissions(value={"ip:mulitiplex:pool:config"}) public String
|
||||
* snatdelete(Integer isAudit,Integer isValid,String ids,Integer
|
||||
* functionId,Model model,RedirectAttributes redirectAttributes
|
||||
* ,HttpServletRequest request,HttpServletResponse response){ try{
|
||||
* if(!StringUtil.isEmpty(ids)){
|
||||
* ipMultiplexPoolCfgService.delete(isAudit,isValid,ids,functionId); }
|
||||
* addMessage(redirectAttributes,"success","delete_success");
|
||||
* }catch(Exception e){ logger.error(e);
|
||||
* addMessage(redirectAttributes,"error","delete_failed"); } return
|
||||
* "redirect:" + adminPath
|
||||
* +"/maintenance/ipMultiplexPoolCfg/snatlist?functionId="+functionId; }
|
||||
*/
|
||||
|
||||
/**
|
||||
* 校验IP是否已存在
|
||||
*
|
||||
* @param cfg
|
||||
* @param redirectAttributes
|
||||
* @param request
|
||||
@@ -248,97 +235,143 @@ public class IpMultiplexPoolCfgController extends BaseController {
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = {"/checkIp"})
|
||||
public boolean checkIp(IpMultiplexPoolCfg cfg, HttpServletRequest request, HttpServletResponse response){
|
||||
@RequestMapping(value = { "/checkIp" })
|
||||
public boolean checkIp(IpMultiplexPoolCfg cfg, HttpServletRequest request, HttpServletResponse response) {
|
||||
// 修改
|
||||
if(!StringUtil.isEmpty(cfg.getCfgId())){
|
||||
if (!StringUtil.isEmpty(cfg.getCfgId())) {
|
||||
IpMultiplexPoolCfg poolCfg = ipMultiplexPoolCfgService.getCfgInfo(cfg);
|
||||
if(poolCfg != null && poolCfg.getDestIpAddress().equals(cfg.getDestIpAddress())){
|
||||
if (poolCfg != null && poolCfg.getDestIpAddress().equals(cfg.getDestIpAddress())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
cfg.setCfgId(null);
|
||||
IpMultiplexPoolCfg poolCfg = ipMultiplexPoolCfgService.getCfgInfo(cfg);
|
||||
if(poolCfg != null){
|
||||
if (poolCfg != null) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
//snat配置导出
|
||||
@RequestMapping(value = "exportSnat")
|
||||
public void exportSnat(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")IpMultiplexPoolCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
|
||||
/*//导出选中记录
|
||||
* if(!StringUtil.isEmpty(ids)){
|
||||
for(String id:ids.split(",")){
|
||||
Long.parseLong(id);
|
||||
}
|
||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
||||
}else{*/
|
||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
||||
Page<IpMultiplexPoolCfg> pageInfo=new Page<IpMultiplexPoolCfg>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(pageInfo, entity);
|
||||
page.setList(ipMultiplexPoolCfgService.getIsp(page.getList()));
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class);
|
||||
String snatNoExport=",server_port,direction,protocol,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,";
|
||||
noExportMap.put(entity.getMenuNameCode(),snatNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("snat export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
|
||||
// snat配置导出
|
||||
@RequestMapping(value = "exportSnat")
|
||||
public void exportSnat(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") IpMultiplexPoolCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
|
||||
/*
|
||||
* //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String
|
||||
* id:ids.split(",")){ Long.parseLong(id); } //List<CfgIndexInfo>
|
||||
* list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename()
|
||||
* , entity.getFunctionId(), ids); }else{
|
||||
*/
|
||||
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||
Page<IpMultiplexPoolCfg> pageInfo = new Page<IpMultiplexPoolCfg>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(pageInfo, entity);
|
||||
page.setList(ipMultiplexPoolCfgService.getIsp(page.getList()));
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class);
|
||||
String snatNoExport = ",server_port,direction,protocol,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
snatNoExport = ",config_time" + snatNoExport;
|
||||
}
|
||||
|
||||
//dnat配置导出
|
||||
@RequestMapping(value = "exportDnat")
|
||||
public void exportDnat(Model model,HttpServletRequest request,HttpServletResponse response,
|
||||
@ModelAttribute("cfg")IpMultiplexPoolCfg entity,String ids,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
//export data info
|
||||
List<String> titleList=new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap=new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap=new HashMap<String, List>();
|
||||
Map<String, String> noExportMap=new HashMap<String, String>();
|
||||
|
||||
|
||||
/*//导出选中记录
|
||||
* if(!StringUtil.isEmpty(ids)){
|
||||
for(String id:ids.split(",")){
|
||||
Long.parseLong(id);
|
||||
}
|
||||
//List<CfgIndexInfo> list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename(), entity.getFunctionId(), ids);
|
||||
}else{*/
|
||||
//条件导出数据大于最大导出数,只导出最大导出条数
|
||||
Page<IpMultiplexPoolCfg> pageInfo=new Page<IpMultiplexPoolCfg>(request, response,"r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(pageInfo, entity);
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class);
|
||||
String snatNoExport=",isp,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,";
|
||||
noExportMap.put(entity.getMenuNameCode(),snatNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
/*}*/
|
||||
this._export(model, request, response, redirectAttributes,entity.getMenuNameCode(),titleList,classMap,dataMap,noExportMap);
|
||||
} catch (Exception e) {
|
||||
logger.error("dnat export failed",e);
|
||||
addMessage(redirectAttributes,"error","export_failed");
|
||||
}
|
||||
//return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
snatNoExport = ",edit_time" + snatNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
snatNoExport = ",audit_time" + snatNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
snatNoExport = "," + entity.gethColumns() + "," + snatNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
logger.error("snat export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
|
||||
// dnat配置导出
|
||||
@RequestMapping(value = "exportDnat")
|
||||
public void exportDnat(Model model, HttpServletRequest request, HttpServletResponse response,
|
||||
@ModelAttribute("cfg") IpMultiplexPoolCfg entity, String ids, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
// export data info
|
||||
List<String> titleList = new ArrayList<String>();
|
||||
Map<String, Class<?>> classMap = new HashMap<String, Class<?>>();
|
||||
Map<String, List> dataMap = new HashMap<String, List>();
|
||||
Map<String, String> noExportMap = new HashMap<String, String>();
|
||||
|
||||
/*
|
||||
* //导出选中记录 if(!StringUtil.isEmpty(ids)){ for(String
|
||||
* id:ids.split(",")){ Long.parseLong(id); } //List<CfgIndexInfo>
|
||||
* list=ipCfgService.getListByCfgIdWithName(IpPortCfg.getTablename()
|
||||
* , entity.getFunctionId(), ids); }else{
|
||||
*/
|
||||
// 条件导出数据大于最大导出数,只导出最大导出条数
|
||||
Page<IpMultiplexPoolCfg> pageInfo = new Page<IpMultiplexPoolCfg>(request, response, "r");
|
||||
pageInfo.setPageNo(1);
|
||||
pageInfo.setPageSize(Constants.MAX_EXPORT_SIZE);
|
||||
Page<IpMultiplexPoolCfg> page = ipMultiplexPoolCfgService.findPage(pageInfo, entity);
|
||||
titleList.add(entity.getMenuNameCode());
|
||||
classMap.put(entity.getMenuNameCode(), IpMultiplexPoolCfg.class);
|
||||
String snatNoExport = ",isp,do_log,whether_area_block,userregion1,userregion2,userregion3,userregion4,userregion5,group_name,";
|
||||
|
||||
// 时间过滤
|
||||
if (entity.getSearch_create_time_start() == null && entity.getSearch_create_time_end() == null) {
|
||||
snatNoExport = ",config_time" + snatNoExport;
|
||||
}
|
||||
if (entity.getSearch_edit_time_start() == null && entity.getSearch_edit_time_end() == null) {
|
||||
snatNoExport = ",edit_time" + snatNoExport;
|
||||
}
|
||||
if (entity.getSearch_audit_time_start() == null && entity.getSearch_audit_time_end() == null) {
|
||||
snatNoExport = ",audit_time" + snatNoExport;
|
||||
}
|
||||
if (!StringUtil.isEmpty(entity.gethColumns())) {
|
||||
snatNoExport = "," + entity.gethColumns() + "," + snatNoExport;
|
||||
}
|
||||
|
||||
noExportMap.put(entity.getMenuNameCode(), snatNoExport);
|
||||
dataMap.put(entity.getMenuNameCode(), page.getList());
|
||||
/* } */
|
||||
|
||||
String timeRange = initTimeMap(entity);
|
||||
noExportMap.put("timeRange", timeRange);
|
||||
if ("csv".equals(entity.getExType())) {
|
||||
this._exportCsv(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
} else {
|
||||
this._export(model, request, response, redirectAttributes, entity.getMenuNameCode(), titleList,
|
||||
classMap, dataMap, noExportMap);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("dnat export failed", e);
|
||||
addMessage(redirectAttributes, "error", "export_failed");
|
||||
}
|
||||
// return "redirect:" + adminPath
|
||||
// +"/ntc/iplist/list?functionId="+entity.getFunctionId();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user