增加配置保护名单管理功能.

This commit is contained in:
zhangwenqing
2019-03-27 18:05:18 +08:00
parent b7a64234f8
commit 08dd0f3868
15 changed files with 838 additions and 20 deletions

View File

@@ -0,0 +1,83 @@
package com.nis.web.controller.basics;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.nis.domain.Page;
import com.nis.domain.basics.ProtectionListInfo;
import com.nis.util.StringUtil;
import com.nis.web.controller.BaseController;
/**
* 内置配置保护名单管理
*/
@Controller
@RequestMapping(value = "${adminPath}/basics/innerProtectionList")
public class InnerProtectionListController extends BaseController{
@RequestMapping(value = {"/list", ""})
public String policyGroupList(ProtectionListInfo cfg,HttpServletRequest request, HttpServletResponse response, Model model,
RedirectAttributes redirectAttributes) {
if(cfg == null)cfg=new ProtectionListInfo();
Page<ProtectionListInfo> pageCondition = new Page<ProtectionListInfo>(request, response,"r");
Page page = innerProtectionListService.findProtectionInfoList(pageCondition,cfg);
model.addAttribute("cfg", cfg);
model.addAttribute("page", page);
return "/basics/protectionInfoList";
}
@RequestMapping(value={"/form"})
public String form(Integer groupType,String ids,Model model,String doAction,RedirectAttributes redirectAttributes) {
ProtectionListInfo protectionListInfo = new ProtectionListInfo();
if(!StringUtil.isEmpty(ids)){
protectionListInfo = innerProtectionListService.getById(Integer.parseInt(ids));
}
model.addAttribute("_cfg", protectionListInfo);
return "/basics/protectionInfoForm";
}
@RequestMapping(value = "saveOrUpdate")
public String saveOrUpdate(ProtectionListInfo cfg,Model model,String itType,Integer groupType,
RedirectAttributes redirectAttributes) {
try {
innerProtectionListService.saveOrUpdate(cfg);
addMessage(redirectAttributes,"success","save_success");
} catch (Exception e) {
logger.error("新增失败",e);
addMessage(redirectAttributes,"error","save_failed");
}
return "redirect:" + adminPath + "/basics/innerProtectionList/list";
}
@RequestMapping(value={"delete"})
public String delete(RedirectAttributes redirectAttributes,String ids,int isValid) {
try {
innerProtectionListService.deldete(ids,isValid);
addMessage(redirectAttributes,"success","delete_success");
} catch (Exception e) {
logger.error("删除失败",e);
addMessage(redirectAttributes,"error","delete_failed");
}
return "redirect:" + adminPath + "/basics/innerProtectionList/list";
}
@RequestMapping(value="ajaxGetAllInfo",method=RequestMethod.GET)
@ResponseBody
public Map<String,List<String>> ajaxGetAllInfo(HttpServletRequest request, HttpServletResponse response){
return innerProtectionListService.ajaxGetAllInfo();
}
}