Merge branch 'develop' of http://10.0.6.99/gwall/gwall.git into develop
This commit is contained in:
@@ -40,6 +40,8 @@ import com.nis.web.service.configuration.SslCfgService;
|
||||
import com.nis.web.service.configuration.StringCfgService;
|
||||
import com.nis.web.service.configuration.TunnelCfgService;
|
||||
import com.nis.web.service.configuration.WebCfgService;
|
||||
import com.nis.web.service.specific.SpecificServiceCfgService;
|
||||
import com.nis.web.service.specific.SpecificServiceHostCfgService;
|
||||
import com.nis.web.service.systemService.ServiceConfigInfoService;
|
||||
import com.nis.web.service.systemService.SystemServiceService;
|
||||
|
||||
@@ -121,6 +123,10 @@ public class BaseController {
|
||||
protected NumCfgService numCfgService;
|
||||
@Autowired
|
||||
protected ComplexStringCfgService complexStringCfgService;
|
||||
@Autowired
|
||||
protected SpecificServiceCfgService specificServiceCfgService;
|
||||
@Autowired
|
||||
protected SpecificServiceHostCfgService specificServiceHostCfgService;
|
||||
/**
|
||||
* 管理基础路径
|
||||
*/
|
||||
|
||||
@@ -77,79 +77,7 @@ public class ServiceDictInfoController extends BaseController {
|
||||
for(int i=0;i<strArr.length;i++){
|
||||
intArr[i] = Integer.valueOf(strArr[i]);
|
||||
}
|
||||
if(serviceDictInfo.getItemType()!=null){
|
||||
model.addAttribute("selectedType", serviceDictInfo.getItemType());
|
||||
}else{
|
||||
model.addAttribute("selectedType", selectedType);
|
||||
serviceDictInfo.setItemType(selectedType);
|
||||
}
|
||||
//查询符合条件总数
|
||||
List<ServiceDictInfo> showTotalCount = serviceDictInfoService.findAllDictSearchList(serviceDictInfo,intArr);
|
||||
model.addAttribute("showTotalCount", showTotalCount.size());
|
||||
|
||||
//查出顶层分页数据
|
||||
Page<ServiceDictInfo> page = serviceDictInfoService.findTopDictList(new Page<ServiceDictInfo>(request, response), serviceDictInfo,intArr);
|
||||
//植入序号
|
||||
for(int i=0;i<page.getList().size();i++){
|
||||
page.getList().get(i).setShowSequence(""+(i+1+((page.getPageNo()-1)*page.getPageSize())));
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
//查出所有数据
|
||||
List<ServiceDictInfo> allList = serviceDictInfoService.findAllDictList();
|
||||
//处理数据,保留顶层中的所有下层数据
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
for(int i=allList.size()-1;i>=0;i--){
|
||||
ServiceDictInfo se = allList.get(i);
|
||||
if(se!=null&&se.getParent()!=null&&se.getParent().getServiceDictId()!=null&&se.getParent().getServiceDictId()==0){
|
||||
allList.remove(se);
|
||||
}
|
||||
}
|
||||
allList.addAll(page.getList());
|
||||
ServiceDictInfo.sortList(list,allList,0,true);
|
||||
|
||||
//处理下级序号
|
||||
ServiceDictInfo.addChildrenSeq(list, 0);
|
||||
model.addAttribute("itType", itType);
|
||||
model.addAttribute("intArr", Arrays.asList(intArr));
|
||||
model.addAttribute("list", list);
|
||||
return "/basics/serviceDictList";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询业务辅助表-业务字典信息列表(含条件查询)
|
||||
* @param serviceDictInfo
|
||||
* @param request
|
||||
* @param response
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = {"searchList"})
|
||||
public String searchList(String itType, ServiceDictInfo serviceDictInfo,HttpServletRequest request, HttpServletResponse response, Model model,Integer selectedType) {
|
||||
if(StringUtils.strIsBlank(serviceDictInfo.getItemValue())
|
||||
&&StringUtils.strIsBlank(serviceDictInfo.getItemCode())
|
||||
&&serviceDictInfo.getBeginDate()==null
|
||||
&&serviceDictInfo.getEndDate()==null
|
||||
&&serviceDictInfo.getEditBeginDate()==null
|
||||
&&serviceDictInfo.getEditEndDate()==null){
|
||||
if(serviceDictInfo.getItemType()!=null){
|
||||
selectedType = serviceDictInfo.getItemType();
|
||||
return "redirect:"+ adminPath + "/basics/serviceDictInfo/list?itType="+itType+"&selectedType="+selectedType+"&isFilterAction="+serviceDictInfo.getIsFilterAction();
|
||||
}
|
||||
return "redirect:"+ adminPath + "/basics/serviceDictInfo/list?itType="+itType+"&isFilterAction="+serviceDictInfo.getIsFilterAction();
|
||||
}
|
||||
String[] strArr = itType.split("-");
|
||||
Integer[] intArr = new Integer[strArr.length];
|
||||
for(int i=0;i<strArr.length;i++){
|
||||
intArr[i] = Integer.valueOf(strArr[i]);
|
||||
}
|
||||
if(serviceDictInfo.getItemType()!=null){
|
||||
model.addAttribute("selectedType", serviceDictInfo.getItemType());
|
||||
}else{
|
||||
model.addAttribute("selectedType", selectedType);
|
||||
serviceDictInfo.setItemType(selectedType);
|
||||
}
|
||||
String searchType = null;
|
||||
String searchContent = null;
|
||||
if(!StringUtils.isBlank(serviceDictInfo.getItemCode())){
|
||||
@@ -163,46 +91,46 @@ public class ServiceDictInfoController extends BaseController {
|
||||
model.addAttribute("searchType", searchType);
|
||||
model.addAttribute("searchContent", searchContent);
|
||||
|
||||
//先查出条件查询所有数据(注意顺序)
|
||||
List<ServiceDictInfo> allList = serviceDictInfoService.findAllDictSearchList(serviceDictInfo,intArr);
|
||||
Page<ServiceDictInfo> pageCondition = new Page<ServiceDictInfo>(request, response);
|
||||
//查询符合条件总数
|
||||
List<ServiceDictInfo> allList = serviceDictInfoService.findAllServiceDictInfo(serviceDictInfo,intArr,pageCondition.getOrderBy());
|
||||
model.addAttribute("showTotalCount", allList.size());
|
||||
//查出条件查询顶层分页数据
|
||||
Page<ServiceDictInfo> page = serviceDictInfoService.findDictTopSearchList(new Page<ServiceDictInfo>(request, response), serviceDictInfo,intArr);
|
||||
//植入序号
|
||||
for(int i=0;i<page.getList().size();i++){
|
||||
page.getList().get(i).setShowSequence(""+(i+1+((page.getPageNo()-1)*page.getPageSize())));
|
||||
|
||||
//查出顶层分页数据
|
||||
Page<ServiceDictInfo> page = serviceDictInfoService.findTopDictList(pageCondition, serviceDictInfo,intArr);
|
||||
// 植入序号
|
||||
for (int i = 0; i < page.getList().size(); i++) {
|
||||
page.getList().get(i).setShowSequence("" + (i + 1 + ((page.getPageNo() - 1) * page.getPageSize())));
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
|
||||
//处理数据,保留顶层中的所有下层数据
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
//取出主键优化处理
|
||||
List<Integer> tempList = Lists.newArrayList();
|
||||
for(ServiceDictInfo se:page.getList()){
|
||||
if(se!=null&&se.getServiceDictId()!=null){
|
||||
tempList.add(se.getServiceDictId());
|
||||
}
|
||||
}
|
||||
//删除所有重复
|
||||
for(int i=allList.size()-1;i>=0;i--){
|
||||
ServiceDictInfo se = allList.get(i);
|
||||
if(se!=null&&se.getServiceDictId()!=null){
|
||||
if(tempList.contains(se.getServiceDictId())||se.getParent().getServiceDictId()==0){
|
||||
allList.remove(se);
|
||||
}
|
||||
// 删除顶层数据、取出id 优化处理
|
||||
List<Integer> intList = Lists.newArrayList();
|
||||
|
||||
for(ServiceDictInfo tempSe : page.getList()) {
|
||||
if (tempSe != null) {
|
||||
intList.add(tempSe.getServiceDictId());
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = allList.size() - 1; i >= 0; i--) {
|
||||
ServiceDictInfo se = allList.get(i);
|
||||
if(se!=null&&intList.contains(se.getServiceDictId())||(se!=null&&se.getParent().getServiceDictId()==0)){
|
||||
allList.remove(se);
|
||||
}
|
||||
}
|
||||
|
||||
List<ServiceDictInfo> list = Lists.newArrayList();
|
||||
|
||||
allList.addAll(page.getList());
|
||||
ServiceDictInfo.sortList(list,allList,0,true);
|
||||
|
||||
//处理下级序号
|
||||
ServiceDictInfo.addChildrenSeq(list, 0);
|
||||
//serviceDictInfo.setItemType(selectedType);
|
||||
model.addAttribute("itType", itType);
|
||||
model.addAttribute("intArr", Arrays.asList(intArr));
|
||||
model.addAttribute("list", list);
|
||||
|
||||
return "/basics/serviceDictInfoSearchList";
|
||||
return "/basics/serviceDictList";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -76,77 +76,8 @@ public class SysDictInfoController extends BaseController {
|
||||
for(int i=0;i<strArr.length;i++){
|
||||
intArr[i] = Integer.valueOf(strArr[i]);
|
||||
}
|
||||
if(sysDictInfo.getItemType()!=null){
|
||||
model.addAttribute("selectedType", sysDictInfo.getItemType());
|
||||
}else{
|
||||
model.addAttribute("selectedType", selectedType);
|
||||
sysDictInfo.setItemType(selectedType);
|
||||
}
|
||||
//查询符合条件总数
|
||||
List<SysDictInfo> showTotalCount = sysDictInfoService.findAllDictSearchList(sysDictInfo,intArr);
|
||||
model.addAttribute("showTotalCount", showTotalCount.size());
|
||||
|
||||
//查出顶层分页数据
|
||||
Page<SysDictInfo> page = sysDictInfoService.findTopDictList(new Page<SysDictInfo>(request, response), sysDictInfo,intArr);
|
||||
//植入序号
|
||||
for(int i=0;i<page.getList().size();i++){
|
||||
page.getList().get(i).setShowSequence(""+(i+1+((page.getPageNo()-1)*page.getPageSize())));
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
//查出所有数据
|
||||
List<SysDictInfo> allList = sysDictInfoService.findAllDictList();
|
||||
//处理数据,保留顶层中的所有下层数据
|
||||
List<SysDictInfo> list = Lists.newArrayList();
|
||||
for(int i=allList.size()-1;i>=0;i--){
|
||||
SysDictInfo se = allList.get(i);
|
||||
if(se!=null&&se.getParent()!=null&&se.getParent().getSysDictId()!=null&&se.getParent().getSysDictId()==0){
|
||||
allList.remove(se);
|
||||
}
|
||||
}
|
||||
allList.addAll(page.getList());
|
||||
SysDictInfo.sortList(list,allList,0,true);
|
||||
|
||||
//处理下级序号
|
||||
SysDictInfo.addChildrenSeq(list, 0);
|
||||
model.addAttribute("itType", itType);
|
||||
model.addAttribute("intArr", Arrays.asList(intArr));
|
||||
model.addAttribute("list", list);
|
||||
return "/basics/sysDictList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询业务辅助表-系统字典信息列表(含条件查询)
|
||||
* @param sysDictInfo
|
||||
* @param request
|
||||
* @param response
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = {"searchList"})
|
||||
public String searchList(String itType, SysDictInfo sysDictInfo,HttpServletRequest request, HttpServletResponse response, Model model, Integer selectedType) {
|
||||
if(StringUtils.strIsBlank(sysDictInfo.getItemValue())
|
||||
&&StringUtils.strIsBlank(sysDictInfo.getItemCode())
|
||||
&&sysDictInfo.getBeginDate()==null
|
||||
&&sysDictInfo.getEndDate()==null
|
||||
&&sysDictInfo.getEditBeginDate()==null
|
||||
&&sysDictInfo.getEditEndDate()==null){
|
||||
if(sysDictInfo.getItemType()!=null){
|
||||
selectedType = sysDictInfo.getItemType();
|
||||
return "redirect:"+ adminPath + "/basics/sysDictInfo/list?itType="+itType+"&selectedType="+selectedType+"&isFilterAction="+sysDictInfo.getIsFilterAction();
|
||||
}
|
||||
return "redirect:"+ adminPath + "/basics/sysDictInfo/list?itType="+itType+"&isFilterAction="+sysDictInfo.getIsFilterAction();
|
||||
}
|
||||
String[] strArr = itType.split("-");
|
||||
Integer[] intArr = new Integer[strArr.length];
|
||||
for(int i=0;i<strArr.length;i++){
|
||||
intArr[i] = Integer.valueOf(strArr[i]);
|
||||
}
|
||||
if(sysDictInfo.getItemType()!=null){
|
||||
model.addAttribute("selectedType", sysDictInfo.getItemType());
|
||||
}else{
|
||||
model.addAttribute("selectedType", selectedType);
|
||||
sysDictInfo.setItemType(selectedType);
|
||||
if(intArr.length==1){
|
||||
model.addAttribute("specType", intArr[0]);
|
||||
}
|
||||
String searchType = null;
|
||||
String searchContent = null;
|
||||
@@ -160,70 +91,52 @@ public class SysDictInfoController extends BaseController {
|
||||
}
|
||||
model.addAttribute("searchType", searchType);
|
||||
model.addAttribute("searchContent", searchContent);
|
||||
//先查出条件查询所有数据(注意顺序)
|
||||
List<SysDictInfo> allList = sysDictInfoService.findAllDictSearchList(sysDictInfo,intArr);
|
||||
if(sysDictInfo.getItemType()!=null){
|
||||
model.addAttribute("selectedType", sysDictInfo.getItemType());
|
||||
}else{
|
||||
model.addAttribute("selectedType", selectedType);
|
||||
sysDictInfo.setItemType(selectedType);
|
||||
}
|
||||
Page<SysDictInfo> pageCondition = new Page<SysDictInfo>(request, response);
|
||||
|
||||
//查询符合条件总数
|
||||
List<SysDictInfo> allList = sysDictInfoService.findAllSysDictInfo(sysDictInfo,intArr,pageCondition.getOrderBy());
|
||||
model.addAttribute("showTotalCount", allList.size());
|
||||
//查出条件查询顶层分页数据
|
||||
Page<SysDictInfo> page = sysDictInfoService.findDictTopSearchList(new Page<SysDictInfo>(request, response), sysDictInfo,intArr);
|
||||
|
||||
//查出顶层分页数据
|
||||
Page<SysDictInfo> page = sysDictInfoService.findTopDictList(pageCondition, sysDictInfo,intArr);
|
||||
//植入序号
|
||||
for(int i=0;i<page.getList().size();i++){
|
||||
page.getList().get(i).setShowSequence(""+(i+1+((page.getPageNo()-1)*page.getPageSize())));
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
|
||||
//处理数据,保留顶层中的所有下层数据
|
||||
|
||||
//处理数据,取出主键优化处理
|
||||
List<Integer> intList = Lists.newArrayList();
|
||||
for(SysDictInfo se:page.getList()){
|
||||
if(se!=null){
|
||||
intList.add(se.getSysDictId());
|
||||
}
|
||||
}
|
||||
|
||||
List<SysDictInfo> list = Lists.newArrayList();
|
||||
//取出主键优化处理
|
||||
List<Integer> tempList = Lists.newArrayList();
|
||||
for(SysDictInfo se:page.getList()){
|
||||
if(se!=null&&se.getSysDictId()!=null){
|
||||
tempList.add(se.getSysDictId());
|
||||
}
|
||||
}
|
||||
//删除所有重复
|
||||
for(int i=allList.size()-1;i>=0;i--){
|
||||
SysDictInfo se = allList.get(i);
|
||||
//System.out.println("删前顺序"+se.getSysDictId());
|
||||
if(se!=null&&se.getSysDictId()!=null){
|
||||
if(tempList.contains(se.getSysDictId())||se.getParent().getSysDictId()==0){
|
||||
allList.remove(se);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* for(int i=allList.size()-1;i>=0;i--){
|
||||
SysDictInfo se = allList.get(i);
|
||||
System.out.println("删后顺序"+se.getSysDictId());
|
||||
}*/
|
||||
|
||||
|
||||
for(int i=allList.size()-1;i>=0;i--){
|
||||
SysDictInfo se = allList.get(i);
|
||||
if(se!=null&&intList.contains(se.getSysDictId())||(se!=null&&se.getParent().getSysDictId()==0)){
|
||||
allList.remove(se);
|
||||
}
|
||||
}
|
||||
allList.addAll(page.getList());
|
||||
SysDictInfo.sortList(list,allList,0,true);
|
||||
|
||||
|
||||
//处理下级序号
|
||||
SysDictInfo.addChildrenSeq(list, 0);
|
||||
/*for(int i=list.size()-1;i>=0;i--){
|
||||
SysDictInfo se = list.get(i);
|
||||
System.out.println("最终顺序"+se.getSysDictId()+":"+se.getParent().getSysDictId());
|
||||
}*/
|
||||
|
||||
model.addAttribute("itType", itType);
|
||||
model.addAttribute("intArr", Arrays.asList(intArr));
|
||||
model.addAttribute("list", list);
|
||||
|
||||
return "/basics/sysDictInfoSearchList";
|
||||
return "/basics/sysDictList";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 进入添加或修改页面
|
||||
* @param sysDictInfo
|
||||
@@ -254,6 +167,9 @@ public class SysDictInfoController extends BaseController {
|
||||
for(int i=0;i<strArr.length;i++){
|
||||
intArr[i] = Integer.valueOf(strArr[i]);
|
||||
}
|
||||
if(intArr.length==1){
|
||||
model.addAttribute("specType", intArr[0]);
|
||||
}
|
||||
model.addAttribute("intArr", Arrays.asList(intArr));
|
||||
model.addAttribute("sysDictInfo", sysDictInfo);
|
||||
model.addAttribute("itType", itType);
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -37,6 +38,7 @@ public class TaskInfoController extends BaseController{
|
||||
/**
|
||||
* 进入用户添加或修改页面
|
||||
*/
|
||||
@RequiresPermissions("basics:taskInfo:edit")
|
||||
@RequestMapping(value={"form"})
|
||||
public String form(TaskInfo taskInfo, Model model) {
|
||||
if(taskInfo.getId()!=null){
|
||||
@@ -51,6 +53,7 @@ public class TaskInfoController extends BaseController{
|
||||
/**
|
||||
* 新增/修改
|
||||
*/
|
||||
@RequiresPermissions("basics:taskInfo:edit")
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(TaskInfo taskInfo, HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
@@ -96,6 +99,7 @@ public class TaskInfoController extends BaseController{
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("basics:taskInfo:edit")
|
||||
@RequestMapping(value = "taskExamine")
|
||||
public String taskExamine(String ids, Model model,RedirectAttributes redirectAttributes){
|
||||
String[] exId = ids.split(",");
|
||||
@@ -110,6 +114,7 @@ public class TaskInfoController extends BaseController{
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("basics:taskInfo:edit")
|
||||
@RequestMapping(value = "taskExamineNo")
|
||||
public String taskExamineNo(String ids, Model model,RedirectAttributes redirectAttributes){
|
||||
String[] noId = ids.split(",");
|
||||
@@ -124,6 +129,7 @@ public class TaskInfoController extends BaseController{
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("basics:taskInfo:edit")
|
||||
@RequestMapping(value = "taskCancelExamine")
|
||||
public String taskCancelExamine(String ids, Model model,RedirectAttributes redirectAttributes){
|
||||
String[] canclelId = ids.split(",");
|
||||
@@ -138,6 +144,7 @@ public class TaskInfoController extends BaseController{
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("basics:taskInfo:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
public String delete(String ids, Model model,RedirectAttributes redirectAttributes){
|
||||
String[] delId = ids.split(",");
|
||||
|
||||
@@ -5,6 +5,7 @@ import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
@@ -38,6 +39,7 @@ public class RequestInfoController extends BaseController{
|
||||
/**
|
||||
* 进入用户添加或修改页面
|
||||
*/
|
||||
@RequiresPermissions("cfg:requestInfo:edit")
|
||||
@RequestMapping(value={"form"})
|
||||
public String form(RequestInfo requestInfo, Model model) {
|
||||
TaskInfo taskInfo = new TaskInfo();
|
||||
@@ -55,6 +57,7 @@ public class RequestInfoController extends BaseController{
|
||||
/**
|
||||
* 新增/修改
|
||||
*/
|
||||
@RequiresPermissions("cfg:requestInfo:edit")
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(RequestInfo requestInfo, HttpServletRequest request, Model model, RedirectAttributes redirectAttributes) {
|
||||
try {
|
||||
@@ -100,6 +103,7 @@ public class RequestInfoController extends BaseController{
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("cfg:requestInfo:edit")
|
||||
@RequestMapping(value = "requestExamine")
|
||||
public String requestExamine(String ids, Model model,RedirectAttributes redirectAttributes){
|
||||
String[] exId = ids.split(",");
|
||||
@@ -114,6 +118,7 @@ public class RequestInfoController extends BaseController{
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("cfg:requestInfo:edit")
|
||||
@RequestMapping(value = "requestExamineNo")
|
||||
public String requestExamineNo(String ids, Model model,RedirectAttributes redirectAttributes){
|
||||
String[] noId = ids.split(",");
|
||||
@@ -128,6 +133,7 @@ public class RequestInfoController extends BaseController{
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("cfg:requestInfo:edit")
|
||||
@RequestMapping(value = "requestCancelExamine")
|
||||
public String requestCancelExamine(String ids, Model model,RedirectAttributes redirectAttributes){
|
||||
String[] canclelId = ids.split(",");
|
||||
@@ -142,6 +148,7 @@ public class RequestInfoController extends BaseController{
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("cfg:requestInfo:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
public String delete(String ids, Model model,RedirectAttributes redirectAttributes){
|
||||
String[] delId = ids.split(",");
|
||||
|
||||
@@ -0,0 +1,292 @@
|
||||
package com.nis.web.controller.specific;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
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.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.specific.SpecificServiceCfg;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.util.StringUtils;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/specific/specificServiceCfg")
|
||||
public class SpecificServiceCfgController extends BaseController {
|
||||
|
||||
/* @ModelAttribute
|
||||
public SpecificServiceCfg get(@RequestParam(required=false)Integer specServiceId) {
|
||||
if (!StringUtil.isEmpty(specServiceId)) {
|
||||
SpecificServiceCfg ss = specificServiceCfgService.getBySpecServiceId(specServiceId);
|
||||
return ss==null?new SpecificServiceCfg():ss;
|
||||
} else {
|
||||
return new SpecificServiceCfg();
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 查出分页列表
|
||||
*
|
||||
* @param specificServiceCfg
|
||||
* @param request
|
||||
* @param response
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = "list")
|
||||
public String list(SpecificServiceCfg specificServiceCfg, HttpServletRequest request, HttpServletResponse response,
|
||||
Model model) {
|
||||
String searchType = null;
|
||||
String searchContent = null;
|
||||
if(specificServiceCfg.getSpecServiceId()!=null){
|
||||
searchType = "specServiceId";
|
||||
searchContent = specificServiceCfg.getSpecServiceId().toString();
|
||||
}
|
||||
if(!StringUtils.isBlank(specificServiceCfg.getSpecServiceName())){
|
||||
searchType = "specServiceName";
|
||||
searchContent = specificServiceCfg.getSpecServiceName();
|
||||
}
|
||||
if(!StringUtils.isBlank(specificServiceCfg.getSpecServiceDesc())){
|
||||
searchType = "specServiceDesc";
|
||||
searchContent = specificServiceCfg.getSpecServiceDesc();
|
||||
}
|
||||
if(specificServiceCfg.getGroupId()!=null){
|
||||
searchType = "groupId";
|
||||
searchContent = specificServiceCfg.getGroupId().toString();
|
||||
}
|
||||
model.addAttribute("searchType", searchType);
|
||||
model.addAttribute("searchContent", searchContent);
|
||||
|
||||
Page<SpecificServiceCfg> pageCondition = new Page<SpecificServiceCfg>(request, response);
|
||||
// 取出所有符合条件的数据
|
||||
List<SpecificServiceCfg> allList = specificServiceCfgService.findAllSpecificServiceCfg(specificServiceCfg,pageCondition.getOrderBy());
|
||||
model.addAttribute("showTotalCount", allList.size());
|
||||
// 取出所有符合条件的顶层分页
|
||||
Page<SpecificServiceCfg> page = specificServiceCfgService
|
||||
.findTopPage(pageCondition, specificServiceCfg);
|
||||
// 植入序号
|
||||
for (int i = 0; i < page.getList().size(); i++) {
|
||||
page.getList().get(i).setShowSequence("" + (i + 1 + ((page.getPageNo() - 1) * page.getPageSize())));
|
||||
}
|
||||
model.addAttribute("page", page);
|
||||
// 删除顶层数据、取出id 优化处理
|
||||
List<Integer> intList = Lists.newArrayList();
|
||||
for (SpecificServiceCfg tempSS : page.getList()) {
|
||||
if (tempSS != null) {
|
||||
intList.add(tempSS.getSpecServiceId());
|
||||
}
|
||||
}
|
||||
for (int i = allList.size() - 1; i >= 0; i--) {
|
||||
SpecificServiceCfg ss = allList.get(i);
|
||||
if ((ss != null && intList.contains(ss.getSpecServiceId())) || (ss != null && ss.getParent().getSpecServiceId() == 0)) {
|
||||
allList.remove(ss);
|
||||
}
|
||||
}
|
||||
|
||||
allList.addAll(page.getList());
|
||||
|
||||
List<SpecificServiceCfg> list = Lists.newArrayList();
|
||||
SpecificServiceCfg.sortList(list, allList, 0, true);
|
||||
//处理下级序号
|
||||
SpecificServiceCfg.addChildrenSeq(list, 0);
|
||||
|
||||
model.addAttribute("list", list);
|
||||
|
||||
return "/specific/specificServiceCfgList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入查看或新增、修改页面
|
||||
*
|
||||
* @param specificServiceCfg
|
||||
* @param model
|
||||
* @param doAction
|
||||
* @param mulitId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = { "form" })
|
||||
public String form(SpecificServiceCfg specificServiceCfg, Model model, String doAction, String mulitId) {
|
||||
|
||||
Integer id = 0;
|
||||
if (mulitId != null) {
|
||||
String[] ids = mulitId.split(",");
|
||||
id = Integer.valueOf(ids[0]);
|
||||
}
|
||||
if (id != 0) {
|
||||
specificServiceCfg = specificServiceCfgService.getBySpecServiceId(id);
|
||||
}
|
||||
if (specificServiceCfg == null || specificServiceCfg.getParent() == null
|
||||
|| specificServiceCfg.getParent().getSpecServiceId() == 0) {
|
||||
SpecificServiceCfg parent = new SpecificServiceCfg();
|
||||
parent.setSpecServiceId(0);
|
||||
parent.setSpecServiceName("根节点");
|
||||
specificServiceCfg.setParent(parent);
|
||||
}
|
||||
model.addAttribute("specificServiceCfg", specificServiceCfg);
|
||||
if (doAction != null && doAction.equals("0")) {
|
||||
return "/specific/specificServiceCfgInfo";
|
||||
}
|
||||
return "/specific/specificServiceCfgForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或保存
|
||||
* @param specificServiceCfg
|
||||
* @param model
|
||||
* @param redirectAttributes
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:edit")
|
||||
@RequestMapping(value="saveOrUpdate")
|
||||
public String saveOrUpdate(SpecificServiceCfg specificServiceCfg, Model model,
|
||||
RedirectAttributes redirectAttributes,Integer oldId) {
|
||||
try {
|
||||
specificServiceCfgService.saveOrUpdate(specificServiceCfg,oldId);
|
||||
addMessage(redirectAttributes, "保存成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "保存失败!");
|
||||
}
|
||||
return "redirect:" + adminPath + "/specific/specificServiceCfg/list";
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除
|
||||
* @param specificServiceCfg
|
||||
* @param redirectAttributes
|
||||
* @param mulitId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="delete")
|
||||
public String delete(SpecificServiceCfg specificServiceCfg, RedirectAttributes redirectAttributes, String mulitId){
|
||||
try{
|
||||
specificServiceCfgService.delete(mulitId);
|
||||
addMessage(redirectAttributes,"删除成功");
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"删除失败");
|
||||
}
|
||||
|
||||
return "redirect:"+adminPath+"/specific/specificServiceCfg/list";
|
||||
}
|
||||
|
||||
/**
|
||||
* 父节点选择树形结构
|
||||
* @param extId
|
||||
* @param isShowHide
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("user")
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "treeData")
|
||||
public List<Map<String, Object>> treeData(@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide, HttpServletResponse response){
|
||||
List<Map<String, Object>> mapList = Lists.newArrayList();
|
||||
Map<String, Object> map2 = Maps.newHashMap();
|
||||
map2.put("id", 0);
|
||||
map2.put("pId", 0);
|
||||
map2.put("name","根节点");
|
||||
//map2.put("placeholder","0");
|
||||
mapList.add(map2);
|
||||
List<SpecificServiceCfg> list = specificServiceCfgService.findAllSpecificServiceCfg(new SpecificServiceCfg(),"");
|
||||
for (int i=0; i<list.size(); i++){
|
||||
SpecificServiceCfg specificServiceCfg = list.get(i);
|
||||
if(StringUtils.isBlank(extId)||(extId!=null&&!extId.equals(specificServiceCfg.getSpecServiceId().toString()))){
|
||||
if(specificServiceCfg.getIsValid().equals(0)||specificServiceCfg.getIsLeaf().equals(1)){
|
||||
continue;
|
||||
}
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
map.put("id", specificServiceCfg.getSpecServiceId());
|
||||
map.put("pId", specificServiceCfg.getParent().getSpecServiceId());
|
||||
map.put("name",specificServiceCfg.getSpecServiceName());
|
||||
mapList.add(map);
|
||||
}
|
||||
}
|
||||
return mapList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验协议id是否重复
|
||||
* @param specServiceId
|
||||
* @param oldId
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "isIdRepeat")
|
||||
public boolean isIdRepeat(String specServiceId,String oldId){
|
||||
if(oldId!=null){
|
||||
if(oldId.trim().equals(specServiceId)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(specServiceId!=null){
|
||||
SpecificServiceCfg ss = specificServiceCfgService.getBySpecServiceId(Integer.valueOf(specServiceId));
|
||||
if(ss==null){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验叶子节点无上级不得选为叶子节点
|
||||
* @param specServiceId
|
||||
* @param oldId
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "ajaxLeafHasTree")
|
||||
public boolean ajaxLeafHasTree(Integer parentId, Integer newIsLeaf){
|
||||
if(parentId==null||parentId==0){
|
||||
if(newIsLeaf==0){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(parentId!=null&parentId!=0){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 校验叶子节点有下级不得更改为叶子节点
|
||||
* @param parent
|
||||
* @param newIsLeaf
|
||||
* @return
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "ajaxLeafChange")
|
||||
public boolean ajaxLeafChange(Integer parent,Integer newIsLeaf){
|
||||
if(parent==null){
|
||||
return true;
|
||||
}
|
||||
List<SpecificServiceCfg> list = specificServiceCfgService.getChildrenById(parent);
|
||||
if(list==null||list.size()==0){
|
||||
return true;
|
||||
}else{
|
||||
if(newIsLeaf==0){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
package com.nis.web.controller.specific;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
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.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.nis.domain.Page;
|
||||
import com.nis.domain.specific.SpecificServiceHostCfg;
|
||||
import com.nis.util.StringUtil;
|
||||
import com.nis.web.controller.BaseController;
|
||||
|
||||
@Controller
|
||||
@RequestMapping(value = "${adminPath}/specific/specificServiceHostCfg")
|
||||
public class SpecificServiceHostCfgController extends BaseController {
|
||||
|
||||
|
||||
@ModelAttribute
|
||||
public SpecificServiceHostCfg get(@RequestParam(required=false) Integer hostId) {
|
||||
if (!StringUtil.isEmpty(hostId)){
|
||||
return specificServiceHostCfgService.getDictByHostId(hostId);
|
||||
}else{
|
||||
return new SpecificServiceHostCfg();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param specificServiceHostCfg
|
||||
* @param request
|
||||
* @param response
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = "list")
|
||||
public String list(SpecificServiceHostCfg specificServiceHostCfg, HttpServletRequest request, HttpServletResponse response,
|
||||
Model model) {
|
||||
|
||||
//查出分页数据
|
||||
Page<SpecificServiceHostCfg> page = specificServiceHostCfgService.findSpecHostList(new Page<SpecificServiceHostCfg>(request, response), specificServiceHostCfg);
|
||||
model.addAttribute("page", page);
|
||||
//查出所有
|
||||
List<SpecificServiceHostCfg> list = specificServiceHostCfgService.getAll();
|
||||
List<Integer> listSpecServiceId = Lists.newArrayList();
|
||||
List<String> listSrcIp = Lists.newArrayList();
|
||||
List<String> listDstIp = Lists.newArrayList();
|
||||
for(SpecificServiceHostCfg ssh:list){
|
||||
if(ssh!=null&&ssh.getSpecServiceId()!=null&&(!listSpecServiceId.contains(ssh.getSpecServiceId()))){
|
||||
listSpecServiceId.add(ssh.getSpecServiceId());
|
||||
}
|
||||
if(ssh!=null&&ssh.getSrcIp()!=null&&(!listSrcIp.contains(ssh.getSrcIp()))){
|
||||
listSrcIp.add(ssh.getSrcIp());
|
||||
}
|
||||
if(ssh!=null&&ssh.getDstIp()!=null&&(!listDstIp.contains(ssh.getDstIp()))){
|
||||
listDstIp.add(ssh.getDstIp());
|
||||
}
|
||||
}
|
||||
model.addAttribute("listSpecServiceId", listSpecServiceId);
|
||||
model.addAttribute("listSrcIp", listSrcIp);
|
||||
model.addAttribute("listDstIp", listDstIp);
|
||||
return "/specific/specificServiceHostCfgList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入查看、修改或新增页面
|
||||
* @param specificServiceHostCfg
|
||||
* @param request
|
||||
* @param response
|
||||
* @param model
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("sys:dict:view")
|
||||
@RequestMapping(value = "form")
|
||||
public String form(SpecificServiceHostCfg specificServiceHostCfg, HttpServletRequest request, HttpServletResponse response, Model model) {
|
||||
|
||||
return "/specific/specificServiceHostCfgForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增或修改
|
||||
* @param specificServiceHostCfg
|
||||
* @param model
|
||||
* @param redirectAttributes
|
||||
* @param mulitId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "saveOrUpdate")
|
||||
public String saveOrUpdate(SpecificServiceHostCfg specificServiceHostCfg,Model model,RedirectAttributes redirectAttributes){
|
||||
try {
|
||||
specificServiceHostCfgService.saveOrUpdate(specificServiceHostCfg);
|
||||
addMessage(redirectAttributes, "保存成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "保存失败!");
|
||||
}
|
||||
return "redirect:"+adminPath+"/specific/specificServiceHostCfg/list";
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
* @param specificServiceHostCfg
|
||||
* @param redirectAttributes
|
||||
* @param mulitId
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value="delete")
|
||||
public String delete(SpecificServiceHostCfg specificServiceHostCfg, RedirectAttributes redirectAttributes, String mulitId){
|
||||
try{
|
||||
specificServiceHostCfgService.delete(mulitId);
|
||||
addMessage(redirectAttributes,"删除成功");
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes,"删除失败");
|
||||
}
|
||||
|
||||
return "redirect:"+adminPath+"/specific/specificServiceHostCfg/list";
|
||||
}
|
||||
/**
|
||||
* 校验spec_service_id重复
|
||||
* @param newId
|
||||
* @param oldId
|
||||
*/
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "isSpecServiceIdRepeat")
|
||||
public boolean isSpecServiceIdRepeat(String newId,String oldId){
|
||||
if(oldId!=null){
|
||||
oldId.trim().equals(newId);
|
||||
return true;
|
||||
}else{
|
||||
SpecificServiceHostCfg sshc = specificServiceHostCfgService.getBySpecServiceId(Integer.valueOf(newId));
|
||||
if(sshc==null){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user