diff --git a/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java b/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java index ffe37f1d1..fe5101587 100644 --- a/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java +++ b/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java @@ -101,8 +101,10 @@ public class SpecificServiceCfg extends BaseEntity{ for(int i=0;i{ private Integer hostId; //host_id 配置ID bigint N 主键,自增 private Integer specServiceId; //spec_service_id 协议id int N protocol_info_cfg.protocol_id + private Integer ipType; //ip地址类型 ipV4=4 ipV6=6 private String srcIp; //src_ip 源IP地址 varchar(64) N 缺省0.0.0.0值表示任意 private String srcIpMask; //src_ip_mask 源地址掩码 varchar(64) N IPV4:255.255.255.255表示无掩码,即精确IP匹配,0.0.0.0值表示任意; //IPV6:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF表示无掩码,::(两个半角冒号)表示任意。非0掩码值必须是2的指数幂,下同。 @@ -61,6 +62,12 @@ public class SpecificServiceHostCfg extends BaseEntity{ public void setSpecServiceId(Integer specServiceId) { this.specServiceId = specServiceId; } + public Integer getIpType() { + return ipType; + } + public void setIpType(Integer ipType) { + this.ipType = ipType; + } public String getSrcIp() { return srcIp; } diff --git a/src/main/java/com/nis/web/controller/basics/ServiceDictInfoController.java b/src/main/java/com/nis/web/controller/basics/ServiceDictInfoController.java index 595c55950..d55e82581 100644 --- a/src/main/java/com/nis/web/controller/basics/ServiceDictInfoController.java +++ b/src/main/java/com/nis/web/controller/basics/ServiceDictInfoController.java @@ -77,79 +77,7 @@ public class ServiceDictInfoController extends BaseController { for(int i=0;i showTotalCount = serviceDictInfoService.findAllDictSearchList(serviceDictInfo,intArr); - model.addAttribute("showTotalCount", showTotalCount.size()); - //查出顶层分页数据 - Page page = serviceDictInfoService.findTopDictList(new Page(request, response), serviceDictInfo,intArr); - //植入序号 - for(int i=0;i allList = serviceDictInfoService.findAllDictList(); - //处理数据,保留顶层中的所有下层数据 - List 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 allList = serviceDictInfoService.findAllDictSearchList(serviceDictInfo,intArr); + Page pageCondition = new Page(request, response); + //查询符合条件总数 + List allList = serviceDictInfoService.findAllServiceDictInfo(serviceDictInfo,intArr,pageCondition.getOrderBy()); model.addAttribute("showTotalCount", allList.size()); - //查出条件查询顶层分页数据 - Page page = serviceDictInfoService.findDictTopSearchList(new Page(request, response), serviceDictInfo,intArr); - //植入序号 - for(int i=0;i 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 list = Lists.newArrayList(); - //取出主键优化处理 - List 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 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 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"; } diff --git a/src/main/java/com/nis/web/controller/basics/SysDictInfoController.java b/src/main/java/com/nis/web/controller/basics/SysDictInfoController.java index 55232636e..a5132ccfd 100644 --- a/src/main/java/com/nis/web/controller/basics/SysDictInfoController.java +++ b/src/main/java/com/nis/web/controller/basics/SysDictInfoController.java @@ -76,30 +76,50 @@ public class SysDictInfoController extends BaseController { for(int i=0;i pageCondition = new Page(request, response); + //查询符合条件总数 - List showTotalCount = sysDictInfoService.findAllDictSearchList(sysDictInfo,intArr); - model.addAttribute("showTotalCount", showTotalCount.size()); + List allList = sysDictInfoService.findAllSysDictInfo(sysDictInfo,intArr,pageCondition.getOrderBy()); + model.addAttribute("showTotalCount", allList.size()); //查出顶层分页数据 - Page page = sysDictInfoService.findTopDictList(new Page(request, response), sysDictInfo,intArr); + Page page = sysDictInfoService.findTopDictList(pageCondition, sysDictInfo,intArr); //植入序号 for(int i=0;i allList = sysDictInfoService.findAllDictList(); - //处理数据,保留顶层中的所有下层数据 + + //处理数据,取出主键优化处理 + List intList = Lists.newArrayList(); + for(SysDictInfo se:page.getList()){ + if(se!=null){ + intList.add(se.getSysDictId()); + } + } + List 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){ + if(se!=null&&intList.contains(se.getSysDictId())||(se!=null&&se.getParent().getSysDictId()==0)){ allList.remove(se); } } @@ -114,116 +134,6 @@ public class SysDictInfoController extends BaseController { 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 allList = sysDictInfoService.findAllDictSearchList(sysDictInfo,intArr); - model.addAttribute("showTotalCount", allList.size()); - //查出条件查询顶层分页数据 - Page page = sysDictInfoService.findDictTopSearchList(new Page(request, response), sysDictInfo,intArr); - //植入序号 - for(int i=0;i list = Lists.newArrayList(); - //取出主键优化处理 - List 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()); - }*/ - - - 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"; - } - - - - - - - - - - /** * 进入添加或修改页面 * @param sysDictInfo diff --git a/src/main/java/com/nis/web/controller/specific/SpecificServiceCfgController.java b/src/main/java/com/nis/web/controller/specific/SpecificServiceCfgController.java index e2ef0a1b0..d660e8c36 100644 --- a/src/main/java/com/nis/web/controller/specific/SpecificServiceCfgController.java +++ b/src/main/java/com/nis/web/controller/specific/SpecificServiceCfgController.java @@ -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 pageCondition = new Page(request, response); // 取出所有符合条件的数据 - List allList = specificServiceCfgService.findAllSpecificServiceCfg(specificServiceCfg); + List allList = specificServiceCfgService.findAllSpecificServiceCfg(specificServiceCfg,pageCondition.getOrderBy()); model.addAttribute("showTotalCount", allList.size()); // 取出所有符合条件的顶层分页 Page page = specificServiceCfgService - .findTopPage(new Page(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 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 list = specificServiceCfgService.findAllSpecificServiceCfg(new SpecificServiceCfg()); + List list = specificServiceCfgService.findAllSpecificServiceCfg(new SpecificServiceCfg(),""); for (int i=0; i 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 list = specificServiceCfgService.getChildrenById(parent); - if(list==null||list.size()>0){ + if(list==null||list.size()==0){ return true; }else{ if(newIsLeaf==0){ diff --git a/src/main/java/com/nis/web/controller/specific/SpecificServiceHostCfgController.java b/src/main/java/com/nis/web/controller/specific/SpecificServiceHostCfgController.java index 875880ed5..2b649b788 100644 --- a/src/main/java/com/nis/web/controller/specific/SpecificServiceHostCfgController.java +++ b/src/main/java/com/nis/web/controller/specific/SpecificServiceHostCfgController.java @@ -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 listSrcIp = Lists.newArrayList(); List 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; + } } diff --git a/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.java b/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.java index 8516bd740..03da7ab3c 100644 --- a/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.java +++ b/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.java @@ -13,17 +13,32 @@ import com.nis.web.dao.MyBatisDao; public interface ServiceDictInfoDao extends CrudDao { /** - * 查询顶层字典列表(无条件查询(==)) + * 查询顶层字典列表(==) * @param serviceDictInfo * @return */ List findTopDictList(ServiceDictInfo serviceDictInfo); /** - * 查询顶层字典列表(无条件查询(!=)) + * 查询顶层字典列表(!=) * @param serviceDictInfo * @return */ List findTopDictListN(ServiceDictInfo serviceDictInfo); + /** + * findAllServiceDictInfo + */ + /** + * 查询所有字典列表(==) + * @param serviceDictInfo + * @return + */ + List findAllServiceDictInfo(@Param("serviceDictInfo")ServiceDictInfo serviceDictInfo,@Param("orderBy")String orderBy); + /** + * 查询所有字典列表(!=) + * @param serviceDictInfo + * @return + */ + List findAllServiceDictInfoN(@Param("serviceDictInfo")ServiceDictInfo serviceDictInfo,@Param("orderBy")String orderBy); /** * 查出所有有效数据 */ @@ -38,32 +53,6 @@ public interface ServiceDictInfoDao extends CrudDao { * @return */ List getDictByParentId(Integer parentId); - /** - * 查询条件查询顶层字典列表(含条件查询(==)) - * @param serviceDictInfo - * @return - */ - List findDictTopSearchList(ServiceDictInfo serviceDictInfo); - /** - * 查询条件查询顶层字典列表(含条件查询(!=)) - * @param serviceDictInfo - * @return - */ - List findDictTopSearchListN(ServiceDictInfo serviceDictInfo); - /** - * 查询条件查询所有字典列表(含条件查询(==)) - * @param serviceDictInfo - * @return - */ - List findAllDictSearchList(ServiceDictInfo serviceDictInfo); - /** - * 查询条件查询所有字典列表(含条件查询(!=)) - * @param serviceDictInfo - * @return - */ - List findAllDictSearchListN(ServiceDictInfo serviceDictInfo); - - /** * 添加字典信息 * @param serviceDictInfo diff --git a/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml b/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml index 8534c417b..1248f2295 100644 --- a/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml +++ b/src/main/java/com/nis/web/dao/basics/ServiceDictInfoDao.xml @@ -68,102 +68,7 @@ - - - - - - - - - - - - - - - - - SELECT * FROM service_dict_info s WHERE s.is_valid=1 @@ -204,12 +109,12 @@ AND s2.create_time <= #{endDate,jdbcType=TIMESTAMP} - - AND edit_time >= #{editBeginDate,jdbcType=TIMESTAMP} - - - AND edit_time <= #{editEndDate,jdbcType=TIMESTAMP} - + + AND edit_time >= #{editBeginDate,jdbcType=TIMESTAMP} + + + AND edit_time <= #{editEndDate,jdbcType=TIMESTAMP} + ) @@ -222,8 +127,8 @@ - - SELECT * FROM service_dict_info s WHERE s.is_valid=1 @@ -265,11 +170,11 @@ AND s2.create_time <= #{endDate,jdbcType=TIMESTAMP} - AND edit_time >= #{editBeginDate,jdbcType=TIMESTAMP} + AND edit_time >= #{editBeginDate,jdbcType=TIMESTAMP} - - AND edit_time <= #{editEndDate,jdbcType=TIMESTAMP} - + + AND edit_time <= #{editEndDate,jdbcType=TIMESTAMP} + ) @@ -281,62 +186,98 @@ - - - - - SELECT * FROM service_dict_info WHERE is_valid=1 - - AND item_value like '%${itemValue}%' + + AND item_value like '%${serviceDictInfo.itemValue}%' - - AND item_code like '%${itemCode}%' + + AND item_code like '%${serviceDictInfo.itemCode}%' - - AND item_type = #{itemType} + + AND item_type = #{serviceDictInfo.itemType} - - AND create_time >= #{beginDate,jdbcType=TIMESTAMP} + + AND create_time >= #{serviceDictInfo.beginDate,jdbcType=TIMESTAMP} - - AND create_time <= #{endDate,jdbcType=TIMESTAMP} + + AND create_time <= #{serviceDictInfo.endDate,jdbcType=TIMESTAMP} - - AND edit_time >= #{editBeginDate,jdbcType=TIMESTAMP} + + AND edit_time >= #{serviceDictInfo.editBeginDate,jdbcType=TIMESTAMP} - - AND edit_time <= #{editEndDate,jdbcType=TIMESTAMP} + + AND edit_time <= #{serviceDictInfo.editEndDate,jdbcType=TIMESTAMP} + + + ORDER BY ${orderBy} + + + ORDER BY create_time desc + + - - SELECT * FROM service_dict_info WHERE is_valid=1 - - AND item_value like '%${itemValue}%' + + AND item_value like '%${serviceDictInfo.itemValue}%' - - AND item_code like '%${itemCode}%' + + AND item_code like '%${serviceDictInfo.itemCode}%' - - AND item_type != #{itemType} + + AND item_type != #{serviceDictInfo.itemType} - - AND create_time >= #{beginDate,jdbcType=TIMESTAMP} + + AND create_time >= #{serviceDictInfo.beginDate,jdbcType=TIMESTAMP} - - AND create_time <= #{endDate,jdbcType=TIMESTAMP} + + AND create_time <= #{serviceDictInfo.endDate,jdbcType=TIMESTAMP} - - AND edit_time >= #{editBeginDate,jdbcType=TIMESTAMP} + + AND edit_time >= #{serviceDictInfo.editBeginDate,jdbcType=TIMESTAMP} - - AND edit_time <= #{editEndDate,jdbcType=TIMESTAMP} + + AND edit_time <= #{serviceDictInfo.editEndDate,jdbcType=TIMESTAMP} + + + ORDER BY ${orderBy} + + + ORDER BY create_time desc + + + + + + + + + + + + diff --git a/src/main/java/com/nis/web/dao/basics/SysDictInfoDao.java b/src/main/java/com/nis/web/dao/basics/SysDictInfoDao.java index 41badab51..0d6597782 100644 --- a/src/main/java/com/nis/web/dao/basics/SysDictInfoDao.java +++ b/src/main/java/com/nis/web/dao/basics/SysDictInfoDao.java @@ -2,6 +2,8 @@ package com.nis.web.dao.basics; import java.util.List; +import org.apache.ibatis.annotations.Param; + import com.nis.domain.basics.SysDictInfo; import com.nis.web.dao.CrudDao; import com.nis.web.dao.MyBatisDao; @@ -12,48 +14,35 @@ public interface SysDictInfoDao extends CrudDao { /** - * 查询顶层字典列表(无条件查询(==)) + * 查询顶层字典列表(==)) * @param sysDictInfo * @return */ List findTopDictList(SysDictInfo sysDictInfo); /** - * 查询顶层字典列表(无条件查询(!=)) + * 查询顶层字典列表(!=) * @param sysDictInfo * @return */ List findTopDictListN(SysDictInfo sysDictInfo); - + /** + * 查询所有字典列表(含条件查询(==)) + * @param sysDictInfo + * @return + */ + List findAllSysDictInfo(@Param("sysDictInfo")SysDictInfo sysDictInfo,@Param("orderBy")String orderBy); + /** + * 查询所有字典列表(含条件查询(!=)) + * @param sysDictInfo + * @return + */ + List findAllSysDictInfoN(@Param("sysDictInfo")SysDictInfo sysDictInfo,@Param("orderBy")String orderBy); /** * 查出所有有效数据 * @param sysDictInfo * @return */ List findAllDictList(SysDictInfo sysDictInfo); - /** - * 查询条件查询顶层字典列表(含条件查询(==)) - * @param sysDictInfo - * @return - */ - List findDictTopSearchList(SysDictInfo sysDictInfo); - /** - * 查询条件查询顶层字典列表(含条件查询(!=)) - * @param sysDictInfo - * @return - */ - List findDictTopSearchListN(SysDictInfo sysDictInfo); - /** - * 查询字典列表(含条件查询(==)) - * @param sysDictInfo - * @return - */ - List findAllDictSearchList(SysDictInfo sysDictInfo); - /** - * 查询字典列表(含条件查询(!=)) - * @param sysDictInfo - * @return - */ - List findAllDictSearchListN(SysDictInfo sysDictInfo); /** * 添加字典信息 * @param sysDictInfo @@ -66,8 +55,6 @@ public interface SysDictInfoDao extends CrudDao { * @return */ SysDictInfo getDictById(Integer sysDictId); - - /** * 查询所有的非叶子配置 * @param itemType diff --git a/src/main/java/com/nis/web/dao/basics/SysDictInfoDao.xml b/src/main/java/com/nis/web/dao/basics/SysDictInfoDao.xml index 736bea552..b3193b41b 100644 --- a/src/main/java/com/nis/web/dao/basics/SysDictInfoDao.xml +++ b/src/main/java/com/nis/web/dao/basics/SysDictInfoDao.xml @@ -50,79 +50,6 @@ LEFT JOIN sys_dict_info p ON p.sys_dict_id = s.parent_id - - - - - - - - SELECT * FROM sys_dict_info s WHERE s.is_valid=1 @@ -192,8 +119,8 @@ - - SELECT * FROM sys_dict_info s WHERE s.is_valid=1 @@ -252,57 +179,73 @@ - - SELECT * FROM sys_dict_info WHERE is_valid=1 - - AND item_type = ${itemType} + + AND item_type = ${sysDictInfo.itemType} - - AND item_code like '%${itemCode}%' + + AND item_code like '%${sysDictInfo.itemCode}%' - - AND item_value like '%${itemValue}%' + + AND item_value like '%${sysDictInfo.itemValue}%' - - AND create_time >= #{beginDate,jdbcType=TIMESTAMP} + + AND create_time >= #{sysDictInfo.beginDate,jdbcType=TIMESTAMP} - - AND create_time <= #{endDate,jdbcType=TIMESTAMP} + + AND create_time <= #{sysDictInfo.endDate,jdbcType=TIMESTAMP} - - AND edit_time >= #{editBeginDate,jdbcType=TIMESTAMP} + + AND edit_time >= #{sysDictInfo.editBeginDate,jdbcType=TIMESTAMP} - - AND edit_time <= #{editEndDate,jdbcType=TIMESTAMP} + + AND edit_time <= #{sysDictInfo.editEndDate,jdbcType=TIMESTAMP} + + + ORDER BY ${orderBy} + + + ORDER BY create_time desc + + - - SELECT * FROM sys_dict_info WHERE is_valid=1 - - AND item_type = ${itemType} + + AND item_type = ${sysDictInfo.itemType} - - AND item_code like '%${itemCode}%' + + AND item_code like '%${sysDictInfo.itemCode}%' - - AND item_value like '%${itemValue}%' + + AND item_value like '%${sysDictInfo.itemValue}%' - - AND create_time >= #{beginDate,jdbcType=TIMESTAMP} + + AND create_time >= #{sysDictInfo.beginDate,jdbcType=TIMESTAMP} - - AND create_time <= #{endDate,jdbcType=TIMESTAMP} + + AND create_time <= #{sysDictInfo.endDate,jdbcType=TIMESTAMP} - - AND edit_time >= #{editBeginDate,jdbcType=TIMESTAMP} + + AND edit_time >= #{sysDictInfo.editBeginDate,jdbcType=TIMESTAMP} - - AND edit_time <= #{editEndDate,jdbcType=TIMESTAMP} + + AND edit_time <= #{sysDictInfo.editEndDate,jdbcType=TIMESTAMP} + + + ORDER BY ${orderBy} + + + ORDER BY create_time desc + + diff --git a/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.java b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.java index a695d1f61..f8168198c 100644 --- a/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.java +++ b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.java @@ -27,7 +27,7 @@ public interface SpecificServiceCfgDao extends CrudDao { * @param specificServiceCfg * @return */ - List findAllSpecificServiceCfg(SpecificServiceCfg specificServiceCfg); + List findAllSpecificServiceCfg(@Param("specificServiceCfg")SpecificServiceCfg specificServiceCfg,@Param("orderBy")String orderBy); /** * 修改配置信息 * @param specificServiceCfg diff --git a/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml index 7a65c3baa..a4830378a 100644 --- a/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml +++ b/src/main/java/com/nis/web/dao/specific/SpecificServiceCfgDao.xml @@ -48,6 +48,9 @@ AND s.spec_service_desc like '%${specServiceDesc}%' + + AND group_id like '%${groupId}%' + AND s.op_time >= #{beginDate,jdbcType=TIMESTAMP} @@ -65,6 +68,9 @@ AND s2.spec_service_desc like '%${specServiceDesc}%' + + AND group_id like '%${groupId}%' + AND s2.op_time >= #{beginDate,jdbcType=TIMESTAMP} @@ -84,26 +90,29 @@ - SELECT * from specific_service_cfg where is_valid = 1 - - AND spec_service_id like '%${specServiceId}%' + + AND spec_service_id like '%${specificServiceCfg.specServiceId}%' - - AND spec_service_name like '%${specServiceName}%' + + AND spec_service_name like '%${specificServiceCfg.specServiceName}%' - - AND spec_service_desc like '%${specServiceDesc}%' + + AND spec_service_desc like '%${specificServiceCfg.specServiceDesc}%' - - AND op_time > #{beginDate} + + AND group_id like '%${specificServiceCfg.groupId}%' - - AND op_time < #{endDate} + + AND op_time > #{specificServiceCfg.beginDate} + + + AND op_time < #{specificServiceCfg.endDate} - - ORDER BY ${page.orderBy} + + ORDER BY ${orderBy} ORDER BY op_time desc diff --git a/src/main/java/com/nis/web/dao/specific/SpecificServiceHostCfgDao.java b/src/main/java/com/nis/web/dao/specific/SpecificServiceHostCfgDao.java index 623f610a2..e8aa88702 100644 --- a/src/main/java/com/nis/web/dao/specific/SpecificServiceHostCfgDao.java +++ b/src/main/java/com/nis/web/dao/specific/SpecificServiceHostCfgDao.java @@ -35,6 +35,13 @@ public interface SpecificServiceHostCfgDao extends CrudDao - + + @@ -39,6 +39,7 @@ s.host_id AS hostId, s.spec_service_id AS specServiceId, + s.ip_type AS ipType, s.src_ip AS srcIp, s.src_ip_mask AS srcIpMask, s.src_port AS srcPort, @@ -70,35 +71,44 @@ select * from specific_service_host_cfg + + + - insert into specific_service_host_cfg (spec_service_id,src_ip,src_ip_mask,src_port,src_port_mask,dst_ip,dst_ip_mask,dst_port,dst_port_mask,direction,protocol,is_valid,is_audit,creator_id,create_time,editor_id,edit_time,auditor_id,audit_time) - values(#{specServiceId},#{srcIp},#{srcIpMask},#{srcPort},#{srcPortMask},#{dstIp},#{dstIpMask},#{dstPort},#{dstPortMask},#{direction},#{protocol},#{isValid},#{isAudit},#{creator.id},#{createTime},#{editor.id},#{editTime},#{auditor.id},#{auditTime}) + insert into specific_service_host_cfg (spec_service_id,ip_type,src_ip,src_ip_mask,src_port,src_port_mask,dst_ip,dst_ip_mask,dst_port,dst_port_mask,direction,protocol,is_valid,is_audit,creator_id,create_time,editor_id,edit_time,auditor_id,audit_time) + values(#{specServiceId},#{ipType},#{srcIp},#{srcIpMask},#{srcPort},#{srcPortMask},#{dstIp},#{dstIpMask},#{dstPort},#{dstPortMask},#{direction},#{protocol},#{isValid},#{isAudit},#{creator.id},#{createTime},#{editor.id},#{editTime},#{auditor.id},#{auditTime}) update specific_service_host_cfg s set s.spec_service_id = #{specServiceId}, + s.ip_type = #{ipType}, s.src_ip = #{srcIp}, s.src_ip_mask = #{srcIpMask}, s.src_port = #{srcPort}, diff --git a/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java b/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java index 33d873c28..075082734 100644 --- a/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java +++ b/src/main/java/com/nis/web/service/basics/ServiceDictInfoService.java @@ -25,7 +25,7 @@ public class ServiceDictInfoService extends BaseService{ private ServiceDictInfoDao serviceDictInfoDao; /** - * 查询业务字典分页(无条件查询) + * 查询业务字典顶层分页 * @param page * @param serviceDictInfo * @return @@ -61,11 +61,67 @@ public class ServiceDictInfoService extends BaseService{ } } - - + ServiceDictInfo sd = new ServiceDictInfo(); + sd.setServiceDictId(0); + for(ServiceDictInfo se:parentList){ + se.setParent(sd); + } + if(tempType!=0){ + serviceDictInfo.setItemType(tempType); + }else{ + serviceDictInfo.setItemType(null); + } page.setList(parentList); return page; } + /** + * 查询所有数据 + * @param serviceDictInfo + * @param itType + * @return + */ + public List findAllServiceDictInfo(ServiceDictInfo serviceDictInfo,Integer[] itType,String orderBy){ + List list = Lists.newArrayList(); + Integer tempType = 0; + if(serviceDictInfo.getItemType()!=null){ + tempType = serviceDictInfo.getItemType(); + } + if(itType.length==1){ + serviceDictInfo.setItemType(itType[0]); + list = serviceDictInfoDao.findAllServiceDictInfo(serviceDictInfo,orderBy); + } + if(itType.length==2){ + if(tempType!=0){ + list = serviceDictInfoDao.findAllServiceDictInfo(serviceDictInfo,orderBy); + }else{ + List tempIntegerList = Lists.newArrayList(); + tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3); + //Map map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE"); + if(tempIntegerList.contains(itType[0])){ + tempIntegerList.remove(itType[0]); + } + if(tempIntegerList.contains(itType[1])){ + tempIntegerList.remove(itType[1]); + } + serviceDictInfo.setItemType(tempIntegerList.get(0)); + list = serviceDictInfoDao.findAllServiceDictInfoN(serviceDictInfo,orderBy); + } + } + if(tempType!=0){ + serviceDictInfo.setItemType(tempType); + }else{ + serviceDictInfo.setItemType(null); + } + return list; + } + + + + + + + + /** * 查询所有有效字典配置 * @return @@ -91,178 +147,6 @@ public class ServiceDictInfoService extends BaseService{ } return list; } - /** - * 查询条件查询顶层分页(含条件查询,考虑排序接入可行性) - * @param page - * @param serviceDictInfo - * @param itType - * @return - */ - public Page findDictTopSearchList(Page page, ServiceDictInfo serviceDictInfo, Integer[] itType) { - // 设置分页参数 - serviceDictInfo.setPage(page); - //根据条件查询符合数据 - List allList = Lists.newArrayList(); - List list = Lists.newArrayList(); - Integer tempType = 0; - if(serviceDictInfo.getItemType()!=null){ - tempType = serviceDictInfo.getItemType(); - } - if(itType.length==1){ - serviceDictInfo.setItemType(itType[0]); - allList = serviceDictInfoDao.findDictTopSearchList(serviceDictInfo); - } - if(itType.length==2){ - if(tempType!=0){ - allList = serviceDictInfoDao.findDictTopSearchList(serviceDictInfo); - }else{ - List tempIntegerList = Lists.newArrayList(); - tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3); - //Map map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE"); - if(tempIntegerList.contains(itType[0])){ - tempIntegerList.remove(itType[0]); - } - if(tempIntegerList.contains(itType[1])){ - tempIntegerList.remove(itType[1]); - } - serviceDictInfo.setItemType(tempIntegerList.get(0)); - allList = serviceDictInfoDao.findDictTopSearchListN(serviceDictInfo); - } - - } - ServiceDictInfo tempSe = new ServiceDictInfo(); - tempSe.setServiceDictId(0); - for(ServiceDictInfo se:allList){ - se.setParent(tempSe); - } - page.setList(allList); - - - /*//根据条件查询符合数据 - List allList = Lists.newArrayList(); - List tempList = Lists.newArrayList(); - List list = Lists.newArrayList(); - List listChild = Lists.newArrayList(); - List listParent = Lists.newArrayList(); - Integer tempType = 0; - Integer total = 0; - Integer pageCount = 0; - Integer lostCount = 0; - if(serviceDictInfo.getItemType()!=null){ - tempType = serviceDictInfo.getItemType(); - } - if(itType.length==1){ - serviceDictInfo.setItemType(itType[0]); - allList = serviceDictInfoDao.findDictSearchList(serviceDictInfo); - } - if(itType.length==2){ - if(tempType!=0){ - allList = serviceDictInfoDao.findDictSearchList(serviceDictInfo); - }else{ - List tempIntegerList = Lists.newArrayList(); - tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3); - //Map map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE"); - if(tempIntegerList.contains(itType[0])){ - tempIntegerList.remove(itType[0]); - } - if(tempIntegerList.contains(itType[1])){ - tempIntegerList.remove(itType[1]); - } - serviceDictInfo.setItemType(tempIntegerList.get(0)); - allList = serviceDictInfoDao.findDictSearchListN(serviceDictInfo); - } - - } - - //处理数据 - //page.list中有多少个不是page.list中的顶层(其上级在page.list) - ServiceDictInfo tempSe = new ServiceDictInfo(); - tempSe.setServiceDictId(0); - //取出主键优化处理 - for(ServiceDictInfo se:allList){ - if(se!=null&&se.getServiceDictId()!=null){ - tempList.add(se.getServiceDictId()); - } - } - - for(ServiceDictInfo se:allList){ - if(se!=null&&se.getParent()!=null&&se.getParent().getServiceDictId()!=null){ - //ServiceDictInfo temp = serviceDictInfoDao.getDictById(se.getParent().getServiceDictId()); - if(tempList.contains(se.getParent().getServiceDictId())){ - listChild.add(se); - lostCount+=lostCount; - }else{ - se.setParent(tempSe); - listParent.add(se); - } - } - } - - //确定总页数 - total = allList.size() - lostCount; - pageCount = total%page.getPageSize()==0?total%page.getPageSize():(total%page.getPageSize()+1); - if(pageCount==0){ - pageCount=1; - } - //取出所有的顶层 - //获取分页 每页数量pageSize、、当前页数pageNo (排序,,,) 每页第一个(pageNo-1)*pageSize+1 最后一个pageNo*pageSize - List parentShow = Lists.newArrayList(); - for(int i=0;i=((page.getPageNo()-1)*page.getPageSize())&&i findAllDictSearchList(ServiceDictInfo serviceDictInfo,Integer[] itType){ - List list = Lists.newArrayList(); - Integer tempType = 0; - if(serviceDictInfo.getItemType()!=null){ - tempType = serviceDictInfo.getItemType(); - } - if(itType.length==1){ - serviceDictInfo.setItemType(itType[0]); - list = serviceDictInfoDao.findAllDictSearchList(serviceDictInfo); - } - if(itType.length==2){ - if(tempType!=0){ - list = serviceDictInfoDao.findAllDictSearchList(serviceDictInfo); - }else{ - List tempIntegerList = Lists.newArrayList(); - tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3); - //Map map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE"); - if(tempIntegerList.contains(itType[0])){ - tempIntegerList.remove(itType[0]); - } - if(tempIntegerList.contains(itType[1])){ - tempIntegerList.remove(itType[1]); - } - serviceDictInfo.setItemType(tempIntegerList.get(0)); - list = serviceDictInfoDao.findAllDictSearchListN(serviceDictInfo); - } - } - if(tempType!=0){ - serviceDictInfo.setItemType(tempType); - }else{ - serviceDictInfo.setItemType(null); - } - return list; - } - - - - /** * 根据主键查询字典详细信息 * @param serviceDictId diff --git a/src/main/java/com/nis/web/service/basics/SysDictInfoService.java b/src/main/java/com/nis/web/service/basics/SysDictInfoService.java index 5c26845a6..b62ef2c68 100644 --- a/src/main/java/com/nis/web/service/basics/SysDictInfoService.java +++ b/src/main/java/com/nis/web/service/basics/SysDictInfoService.java @@ -24,126 +24,32 @@ public class SysDictInfoService extends BaseService{ - /** - * 查询顶层分页(无条件查询) + * 查询顶层分页(含条件查询,考虑排序接入可行性) * @param page * @param sysDictInfo * @param itType * @return */ public Page findTopDictList(Page page, SysDictInfo sysDictInfo, Integer[] itType) { - // 设置分页参数 - sysDictInfo.setPage(page); - List parentList = Lists.newArrayList(); - Integer tempType = 0; - //预留以后分开用 - if(sysDictInfo.getItemType()!=null){ - tempType = sysDictInfo.getItemType(); - } - //查出顶层分页查询 - if(itType.length==1){ - sysDictInfo.setItemType(itType[0]); - parentList = sysDictInfoDao.findTopDictList(sysDictInfo); - } - if(itType.length==2){ - if(tempType!=0){ - parentList = sysDictInfoDao.findTopDictList(sysDictInfo); - }else{ - List tempList = Lists.newArrayList(); - tempList.add(1);tempList.add(2);tempList.add(3); - //Map map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE"); - if(tempList.contains(itType[0])){ - tempList.remove(itType[0]); - } - if(tempList.contains(itType[1])){ - tempList.remove(itType[1]); - } - sysDictInfo.setItemType(tempList.get(0)); - parentList = sysDictInfoDao.findTopDictListN(sysDictInfo); - } - - } - page.setList(parentList); - return page; - } - /** - * 查询所有有效字典配置 - */ - public List findAllDictList() { - return sysDictInfoDao.findAllDictList(new SysDictInfo()); - - } - /** - * 条件查询所有数据 - * @param page - * @param sysDictInfo - * @param intArr - * @return - */ - public List findAllDictSearchList(SysDictInfo sysDictInfo, Integer[] itType) { - - List list = Lists.newArrayList(); - Integer tempType = 0; - if(sysDictInfo.getItemType()!=null){ - tempType = sysDictInfo.getItemType(); - } - if(itType.length==1){ - sysDictInfo.setItemType(itType[0]); - list = sysDictInfoDao.findAllDictSearchList(sysDictInfo); - } - if(itType.length==2){ - if(tempType!=0){ - list = sysDictInfoDao.findAllDictSearchList(sysDictInfo); - }else{ - List tempIntegerList = Lists.newArrayList(); - tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3); - //Map map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE"); - if(tempIntegerList.contains(itType[0])){ - tempIntegerList.remove(itType[0]); - } - if(tempIntegerList.contains(itType[1])){ - tempIntegerList.remove(itType[1]); - } - sysDictInfo.setItemType(tempIntegerList.get(0)); - list = sysDictInfoDao.findAllDictSearchListN(sysDictInfo); - } - } - if(tempType!=0){ - sysDictInfo.setItemType(tempType); - }else{ - sysDictInfo.setItemType(null); - } - return list; - } - /** - * 查询条件查询顶层分页(含条件查询,考虑排序接入可行性) - * @param page - * @param sysDictInfo - * @param itType - * @return - */ - public Page findDictTopSearchList(Page page, SysDictInfo sysDictInfo, Integer[] itType) { // 设置分页参数 sysDictInfo.setPage(page); //根据条件查询符合数据 List allList = Lists.newArrayList(); - List list = Lists.newArrayList(); Integer tempType = 0; if(sysDictInfo.getItemType()!=null){ tempType = sysDictInfo.getItemType(); } if(itType.length==1){ sysDictInfo.setItemType(itType[0]); - allList = sysDictInfoDao.findDictTopSearchList(sysDictInfo); + allList = sysDictInfoDao.findTopDictList(sysDictInfo); } if(itType.length==2){ if(tempType!=0){ - allList = sysDictInfoDao.findDictTopSearchList(sysDictInfo); + allList = sysDictInfoDao.findTopDictList(sysDictInfo); }else{ List tempIntegerList = Lists.newArrayList(); tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3); - //Map map = DictUtils.getDictOption("SERVICE_DICT_ITM_TYPE"); if(tempIntegerList.contains(itType[0])){ tempIntegerList.remove(itType[0]); } @@ -151,11 +57,16 @@ public class SysDictInfoService extends BaseService{ tempIntegerList.remove(itType[1]); } sysDictInfo.setItemType(tempIntegerList.get(0)); - allList = sysDictInfoDao.findDictTopSearchListN(sysDictInfo); + allList = sysDictInfoDao.findTopDictListN(sysDictInfo); } } - allList = sysDictInfoDao.findDictTopSearchList(sysDictInfo); + //allList = sysDictInfoDao.findDictTopSearchList(sysDictInfo); + if(tempType!=0){ + sysDictInfo.setItemType(tempType); + }else{ + sysDictInfo.setItemType(null); + } SysDictInfo tempSe = new SysDictInfo(); tempSe.setSysDictId(0); for(SysDictInfo se:allList){ @@ -166,6 +77,60 @@ public class SysDictInfoService extends BaseService{ return page; } + + /** + * 查询所有数据 + * @param page + * @param sysDictInfo + * @param intArr + * @return + */ + public List findAllSysDictInfo(SysDictInfo sysDictInfo, Integer[] itType,String orderBy) { + + List list = Lists.newArrayList(); + Integer tempType = 0; + if(sysDictInfo.getItemType()!=null){ + tempType = sysDictInfo.getItemType(); + } + if(itType.length==1){ + sysDictInfo.setItemType(itType[0]); + list = sysDictInfoDao.findAllSysDictInfo(sysDictInfo,orderBy); + } + if(itType.length==2){ + if(tempType!=0){ + list = sysDictInfoDao.findAllSysDictInfo(sysDictInfo,orderBy); + }else{ + List tempIntegerList = Lists.newArrayList(); + tempIntegerList.add(1);tempIntegerList.add(2);tempIntegerList.add(3); + if(tempIntegerList.contains(itType[0])){ + tempIntegerList.remove(itType[0]); + } + if(tempIntegerList.contains(itType[1])){ + tempIntegerList.remove(itType[1]); + } + sysDictInfo.setItemType(tempIntegerList.get(0)); + list = sysDictInfoDao.findAllSysDictInfoN(sysDictInfo,orderBy); + } + } + if(tempType!=0){ + sysDictInfo.setItemType(tempType); + }else{ + sysDictInfo.setItemType(null); + } + return list; + } + + + + /** + * 查询所有有效字典配置 + */ + public List findAllDictList() { + return sysDictInfoDao.findAllDictList(new SysDictInfo()); + + } + + /** * 根据主键查询生效范围字典详细信息 diff --git a/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java b/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java index 31027b513..ebdb221e2 100644 --- a/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java +++ b/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java @@ -52,14 +52,17 @@ public class SpecificServiceCfgService extends BaseService{ * @param specificServiceCfg * @return */ - public List findAllSpecificServiceCfg(SpecificServiceCfg specificServiceCfg) { - return specificServiceCfgDao.findAllSpecificServiceCfg(specificServiceCfg); + public List findAllSpecificServiceCfg(SpecificServiceCfg specificServiceCfg, String orderBy) { + return specificServiceCfgDao.findAllSpecificServiceCfg(specificServiceCfg,orderBy); } /** * 保存或修改 * @param specificServiceCfg */ public void saveOrUpdate(SpecificServiceCfg specificServiceCfg, Integer oldId) { + if(specificServiceCfg.getGroupId()==null){ + specificServiceCfg.setGroupId(0); + } if(oldId==null){//新增 specificServiceCfg.setIsValid(1); specificServiceCfg.setOpTime(new Date()); @@ -94,7 +97,7 @@ public class SpecificServiceCfgService extends BaseService{ List list = Lists.newArrayList(); //找出所有下级 if(specificServiceCfg!=null){ - SpecificServiceCfg.sortList(list, specificServiceCfgDao.findAllSpecificServiceCfg(new SpecificServiceCfg()), specificServiceCfg.getSpecServiceId(), true); + SpecificServiceCfg.sortList(list, specificServiceCfgDao.findAllSpecificServiceCfg(new SpecificServiceCfg(),""), specificServiceCfg.getSpecServiceId(), true); list.add(specificServiceCfg); for(SpecificServiceCfg ss:list){ ss.setIsValid(0); diff --git a/src/main/java/com/nis/web/service/specific/SpecificServiceHostCfgService.java b/src/main/java/com/nis/web/service/specific/SpecificServiceHostCfgService.java index 32b1b405d..ce788064f 100644 --- a/src/main/java/com/nis/web/service/specific/SpecificServiceHostCfgService.java +++ b/src/main/java/com/nis/web/service/specific/SpecificServiceHostCfgService.java @@ -55,16 +55,20 @@ public class SpecificServiceHostCfgService extends BaseService{ specificServiceHostCfg.setCreateTime(date); specificServiceHostCfg.setEditor(user); specificServiceHostCfg.setEditTime(date); + specificServiceHostCfg.setAuditor(user); + specificServiceHostCfg.setAuditTime(date); specificServiceHostCfgDao.insert(specificServiceHostCfg); }else{//修改 //是否进行了审核操作 - SpecificServiceHostCfg ssh = specificServiceHostCfgDao.getByHostId(specificServiceHostCfg.getHostId()); - if(ssh.getIsAudit()!=specificServiceHostCfg.getIsAudit()){ + //SpecificServiceHostCfg ssh = specificServiceHostCfgDao.getByHostId(specificServiceHostCfg.getHostId()); + /*if(ssh.getIsAudit()!=specificServiceHostCfg.getIsAudit()){ specificServiceHostCfg.setAuditor(user); specificServiceHostCfg.setAuditTime(date); - } + }*/ specificServiceHostCfg.setEditor(user); specificServiceHostCfg.setEditTime(date); + specificServiceHostCfg.setAuditor(user); + specificServiceHostCfg.setAuditTime(date); specificServiceHostCfgDao.update(specificServiceHostCfg); } } @@ -90,6 +94,16 @@ public class SpecificServiceHostCfgService extends BaseService{ } } } + + /** + * 根据协议ID查询对象 + * @param specServiceId + * @return + */ + public SpecificServiceHostCfg getBySpecServiceId(Integer specServiceId) { + + return specificServiceHostCfgDao.getBySpecServiceId(specServiceId); + } diff --git a/src/main/resources/messages/message_en.properties b/src/main/resources/messages/message_en.properties index b1e0d5f15..d869bf760 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -96,7 +96,6 @@ sysService_manage=system service manage service_manage=service type manage system_service_manage=system service type manage specific_service_cfg=specific service cfg -specific_service_host_cfg=specific service host cfg #============menu end====================== #============yewu begin====================== diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 0b41dd96d..14ad24029 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -96,7 +96,6 @@ sysService_manage=system service manage service_manage=service type manage system_service_manage=system service type manage specific_service_cfg=specific service cfg -specific_service_host_cfg=specific service host cfg #============menu end====================== #============yewu begin====================== diff --git a/src/main/resources/messages/message_zh_CN.properties b/src/main/resources/messages/message_zh_CN.properties index ffb07381a..4b02aca8f 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -96,7 +96,6 @@ sysService_manage=\u7cfb\u7edf\u4e1a\u52a1\u7ba1\u7406 service_manage=\u4e1a\u52a1\u7c7b\u578b\u7ba1\u7406 system_service_manage=\u7cfb\u7edf\u4e1a\u52a1\u7c7b\u578b\u7ba1\u7406 specific_service_cfg=\u7279\u5b9a\u670d\u52a1\u7ba1\u7406 -specific_service_host_cfg=\u7279\u5b9a\u670d\u52a1\u670d\u52a1\u5668IP\u7ba1\u7406 #==========menu end===================== #==========yewu zidian begin===================== diff --git a/src/main/webapp/WEB-INF/views/basics/serviceDictList.jsp b/src/main/webapp/WEB-INF/views/basics/serviceDictList.jsp index cdae694f7..7c3862c82 100644 --- a/src/main/webapp/WEB-INF/views/basics/serviceDictList.jsp +++ b/src/main/webapp/WEB-INF/views/basics/serviceDictList.jsp @@ -58,14 +58,6 @@ $("#searchForm").attr("action","${ctx}/basics/serviceDictInfo/list?itType=${itType}"); $("#searchForm").submit(); return false; - } - function page2(n,s){ - $("#intype").attr("name",$("#seltype").val()); - $("#pageNo").val(n); - $("#pageSize").val(s); - $("#searchForm").attr("action","${ctx}/basics/serviceDictInfo/searchList?itType=${itType}"); - $("#searchForm").submit(); - return false; } $(document).ready(function() { @@ -77,6 +69,11 @@ $("#intype").attr("name",$("#seltype").find("option:selected").val()); $("#intype").val('${searchContent}'); + //reset + $("#resetBtn").on("click",function(){ + $(".Wdate").attr("value",''); + $("#searchForm")[0].reset(); + }); //筛选功能初始化 filterActionInit(); @@ -123,13 +120,13 @@
- + - +
@@ -160,7 +157,7 @@
- +
@@ -229,8 +226,8 @@
- - + +
@@ -247,9 +244,9 @@ - +
- +
@@ -260,9 +257,9 @@ - - + @@ -305,6 +302,7 @@
+
${page}
+
diff --git a/src/main/webapp/WEB-INF/views/basics/sysDictList.jsp b/src/main/webapp/WEB-INF/views/basics/sysDictList.jsp index e2191953d..8c00f157c 100644 --- a/src/main/webapp/WEB-INF/views/basics/sysDictList.jsp +++ b/src/main/webapp/WEB-INF/views/basics/sysDictList.jsp @@ -64,14 +64,6 @@ $("#searchForm").submit(); return false; } - function page2(n,s){ - $("#intype").attr("name",$("#seltype").val()); - $("#pageNo").val(n); - $("#pageSize").val(s); - $("#searchForm").attr("action","${ctx}/basics/sysDictInfo/searchList?itType=${itType}"); - $("#searchForm").submit(); - return false; - } $(document).ready(function() { //设定显示总条数 $("#showTotalCount").text('${showTotalCount}'); @@ -79,8 +71,13 @@ $("#seltype").find("option[value='${searchType==null?11:searchType}']").attr("selected",true); $("#intype").attr("name",$("#seltype").find("option:selected").val()); - $("#intype").val('${sysDictInfo.itemValue}'); - + $("#intype").val('${searchContent}'); + + //reset + $("#resetBtn").on("click",function(){ + $(".Wdate").attr("value",''); + $("#searchForm")[0].reset(); + }); //筛选功能初始化 filterActionInit(); @@ -126,13 +123,13 @@
- + - +
@@ -163,7 +160,7 @@
- +
@@ -232,8 +229,8 @@
- - + +
@@ -250,9 +247,9 @@ - +
- +
@@ -263,9 +260,9 @@ - - + @@ -308,6 +305,7 @@
+
${page}
+
diff --git a/src/main/webapp/WEB-INF/views/specific/specificServiceCfgForm.jsp b/src/main/webapp/WEB-INF/views/specific/specificServiceCfgForm.jsp index 164871a6f..f29342436 100644 --- a/src/main/webapp/WEB-INF/views/specific/specificServiceCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/specific/specificServiceCfgForm.jsp @@ -3,12 +3,12 @@ - + + @@ -104,7 +122,7 @@

- 特定服务信息 +

@@ -122,28 +140,33 @@ +
- +
- +
- +
+
@@ -206,9 +229,9 @@ - +
- +
@@ -218,9 +241,9 @@ - - - + +<%-- + --%> @@ -233,7 +256,7 @@ - + --%>
协议描述 maat端配置分组id 操作时间
操作时间
${specificServiceCfg.groupId } ${fns:getDictLabel("SYS_YES_NO",specificServiceCfg.isLeaf,"0")} + <%--
-
${page}
+
diff --git a/src/main/webapp/WEB-INF/views/specific/specificServiceHostCfgForm.jsp b/src/main/webapp/WEB-INF/views/specific/specificServiceHostCfgForm.jsp index 03596f9ca..6c04c00bf 100644 --- a/src/main/webapp/WEB-INF/views/specific/specificServiceHostCfgForm.jsp +++ b/src/main/webapp/WEB-INF/views/specific/specificServiceHostCfgForm.jsp @@ -7,57 +7,106 @@ - - - - - - - - - - - - - - +<spring:message code="agreement_ip_configuration" />