分类性质标签、地域运营商作用域:融合自定义显示,添加排序,优化代码,
特定服务器管理:修正列表分页显示,条件查询,添加自定义显示,添加排序,新增修改页面添加表单校验, 协议ip配置:修正条件查询,添加自定义显示,添加排序,新增修改页面添加表单校验(ipV4\ipV6地址及掩码校验,端口校验)
This commit is contained in:
@@ -60,15 +60,24 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
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);
|
||||
List<SpecificServiceCfg> allList = specificServiceCfgService.findAllSpecificServiceCfg(specificServiceCfg,pageCondition.getOrderBy());
|
||||
model.addAttribute("showTotalCount", allList.size());
|
||||
// 取出所有符合条件的顶层分页
|
||||
Page<SpecificServiceCfg> page = specificServiceCfgService
|
||||
.findTopPage(new Page<SpecificServiceCfg>(request, response), specificServiceCfg);
|
||||
.findTopPage(pageCondition, specificServiceCfg);
|
||||
// 植入序号
|
||||
for (int i = 0; i < page.getList().size(); i++) {
|
||||
page.getList().get(i).setShowSequence("" + (i + 1 + ((page.getPageNo() - 1) * page.getPageSize())));
|
||||
@@ -83,12 +92,13 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
}
|
||||
for (int i = allList.size() - 1; i >= 0; i--) {
|
||||
SpecificServiceCfg ss = allList.get(i);
|
||||
if ((ss != null && intList.contains(ss.getSpecServiceId())) || (ss != null && ss.getSpecServiceId() == 0)) {
|
||||
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);
|
||||
//处理下级序号
|
||||
@@ -192,11 +202,11 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
map2.put("name","根节点");
|
||||
//map2.put("placeholder","0");
|
||||
mapList.add(map2);
|
||||
List<SpecificServiceCfg> list = specificServiceCfgService.findAllSpecificServiceCfg(new SpecificServiceCfg());
|
||||
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()==0){
|
||||
if(specificServiceCfg.getIsValid().equals(0)&&specificServiceCfg.getIsLeaf().equals(1)){
|
||||
continue;
|
||||
}
|
||||
Map<String, Object> map = Maps.newHashMap();
|
||||
@@ -218,10 +228,10 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
@ResponseBody
|
||||
@RequestMapping(value = "isIdRepeat")
|
||||
public boolean isIdRepeat(String specServiceId,String oldId){
|
||||
System.out.println(specServiceId +"--"+specServiceId);
|
||||
System.out.println(oldId.trim().equals(specServiceId));
|
||||
if(oldId.trim().equals(specServiceId)){
|
||||
return true;
|
||||
if(oldId!=null){
|
||||
if(oldId.trim().equals(specServiceId)){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if(specServiceId!=null){
|
||||
SpecificServiceCfg ss = specificServiceCfgService.getBySpecServiceId(Integer.valueOf(specServiceId));
|
||||
@@ -269,7 +279,7 @@ public class SpecificServiceCfgController extends BaseController {
|
||||
return true;
|
||||
}
|
||||
List<SpecificServiceCfg> list = specificServiceCfgService.getChildrenById(parent);
|
||||
if(list==null||list.size()>0){
|
||||
if(list==null||list.size()==0){
|
||||
return true;
|
||||
}else{
|
||||
if(newIsLeaf==0){
|
||||
|
||||
@@ -13,6 +13,7 @@ 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;
|
||||
@@ -57,13 +58,13 @@ public class SpecificServiceHostCfgController extends BaseController {
|
||||
List<String> listSrcIp = Lists.newArrayList();
|
||||
List<String> listDstIp = Lists.newArrayList();
|
||||
for(SpecificServiceHostCfg ssh:list){
|
||||
if(ssh!=null&ssh.getSpecServiceId()!=null){
|
||||
if(ssh!=null&&ssh.getSpecServiceId()!=null&&(!listSpecServiceId.contains(ssh.getSpecServiceId()))){
|
||||
listSpecServiceId.add(ssh.getSpecServiceId());
|
||||
}
|
||||
if(ssh!=null&ssh.getSrcIp()!=null){
|
||||
if(ssh!=null&&ssh.getSrcIp()!=null&&(!listSrcIp.contains(ssh.getSrcIp()))){
|
||||
listSrcIp.add(ssh.getSrcIp());
|
||||
}
|
||||
if(ssh!=null&ssh.getDstIp()!=null){
|
||||
if(ssh!=null&&ssh.getDstIp()!=null&&(!listDstIp.contains(ssh.getDstIp()))){
|
||||
listDstIp.add(ssh.getDstIp());
|
||||
}
|
||||
}
|
||||
@@ -105,7 +106,7 @@ public class SpecificServiceHostCfgController extends BaseController {
|
||||
e.printStackTrace();
|
||||
addMessage(redirectAttributes, "保存失败!");
|
||||
}
|
||||
return "redirect:"+adminPath+"/specific/specificServiceHostCfgList";
|
||||
return "redirect:"+adminPath+"/specific/specificServiceHostCfg/list";
|
||||
}
|
||||
/**
|
||||
* 删除
|
||||
@@ -126,5 +127,23 @@ public class SpecificServiceHostCfgController extends BaseController {
|
||||
|
||||
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