diff --git a/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java b/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java new file mode 100644 index 000000000..fe5101587 --- /dev/null +++ b/src/main/java/com/nis/domain/specific/SpecificServiceCfg.java @@ -0,0 +1,154 @@ +package com.nis.domain.specific; + +import java.util.Date; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.nis.domain.BaseEntity; +import com.nis.util.Configurations; + +/** + * 系统特定服务信息表-记录特定服务信息(specific_service_cfg) + * @author zsl + * + */ +public class SpecificServiceCfg extends BaseEntity{ + + private static final long serialVersionUID = -1133644323636425766L; + + private Integer specServiceId; //spec_service_id 协议ID int N 主键,初始化 + //private Integer specServiceCode; //协议编码 int N 暂定,以后可扩展 1000:微信 , 1001:QQ + private String specServiceName; //spec_service_name 协议名称 varchar(64) N + private String specServiceDesc; //spec_service_desc 协议描述 varchar2(64) N + private Integer isValid; //is_valid 有效标志 int N 1-有效 0-无效 + private Date opTime; //op_time 操作时间 date N + private SpecificServiceCfg parent; //parent_id 父节点id int N 0表示一级节点 + private Integer isLeaf; //is_leaf 是否是叶子节点 int N 0否,1是,只有一级填0 + private Integer groupId; //group_id maat端配置分组id int N 缺省0,表示未与maat分组同步 + + private Date beginDate; // 开始日期 + private Date endDate; // 结束日期 + private String showSequence; //显示序号 + + public Integer getSpecServiceId() { + return specServiceId; + } + public void setSpecServiceId(Integer specServiceId) { + this.specServiceId = specServiceId; + } + public String getSpecServiceName() { + return specServiceName; + } + public void setSpecServiceName(String specServiceName) { + this.specServiceName = specServiceName; + } + public String getSpecServiceDesc() { + return specServiceDesc; + } + public void setSpecServiceDesc(String specServiceDesc) { + this.specServiceDesc = specServiceDesc; + } + public Integer getIsValid() { + return isValid; + } + public void setIsValid(Integer isValid) { + this.isValid = isValid; + } + public Date getOpTime() { + return opTime; + } + public void setOpTime(Date opTime) { + this.opTime = opTime; + } + public SpecificServiceCfg getParent() { + return parent; + } + public void setParent(SpecificServiceCfg parent) { + this.parent = parent; + } + public Integer getIsLeaf() { + return isLeaf; + } + public void setIsLeaf(Integer isLeaf) { + this.isLeaf = isLeaf; + } + public Integer getGroupId() { + return groupId; + } + public void setGroupId(Integer groupId) { + this.groupId = groupId; + } + public Date getBeginDate() { + return beginDate; + } + public void setBeginDate(Date beginDate) { + this.beginDate = beginDate; + } + public Date getEndDate() { + return endDate; + } + public void setEndDate(Date endDate) { + this.endDate = endDate; + } + public String getShowSequence() { + return showSequence; + } + public void setShowSequence(String showSequence) { + this.showSequence = showSequence; + } + @JsonIgnore + public static void sortList(List list, List allList, Integer parentId, boolean cascade) { + + for(int i=0;i list,Integer parentId){ + int countNo = 1; + for(int i=0; i{ + + private static final long serialVersionUID = -301627652860717175L; + + 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的指数幂,下同。 + private String srcPort; //src_port 源端口 varchar(6) N 0表示任意值 + private String srcPortMask; //src_port_mask 源端口掩码 varchar(6) N 65535表示无掩码,即精确端口匹配,0表示任意 + private String dstIp; //dst_ip 目的IP地址 varchar(64) N 缺省0.0.0.0值表示任意 + private String dstIpMask; //dst_ip_mask 目的地址掩码 varchar(64) N 同源ip地址掩码 + private String dstPort; //dst_port 目的端口 varchar(6) N 目的端口,0表示任意值 + private String dstPortMask; //dst_port_mask 目的端口掩码 varchar(6) N 同源端口掩码 + private Integer direction;; //direction 方向 int N 0双向,1单向,默认缺省为双向。 + private Integer protocol; //protocol 协议 int N 6表示tcp,17表示udp,0表示任意 + private Integer isValid; //is_valid 有效标识 int N 0无效,1有效 + private Integer isAudit; //is_audit 是否审核 int N 0未审核,1审核通过,2审核未通过,3取消审核通过(即删除) + private SysUser creator; //creator_id 创建人员 int N 取自sys_user.id + private Date createTime; //create_time 配置时间 date N + private SysUser editor; //editor_id 修改人员 int Y 取自sys_user.id + private Date editTime; //edit_time 修改时间 date Y + private SysUser auditor; //auditor_id 审核人员 int Y 取自sys_user.id + private Date auditTime; //audit_time 审核时间 date Y + + + + + private Date beginDate; + private Date endDate; + private Date editBeginDate; + private Date editEndDate; + private Date auditBeginDate; + private Date auditEndDate; + + + public Integer getHostId() { + return hostId; + } + public void setHostId(Integer hostId) { + this.hostId = hostId; + } + public Integer getSpecServiceId() { + return specServiceId; + } + 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; + } + public void setSrcIp(String srcIp) { + this.srcIp = srcIp; + } + public String getSrcIpMask() { + return srcIpMask; + } + public void setSrcIpMask(String srcIpMask) { + this.srcIpMask = srcIpMask; + } + public String getSrcPort() { + return srcPort; + } + public void setSrcPort(String srcPort) { + this.srcPort = srcPort; + } + public String getSrcPortMask() { + return srcPortMask; + } + public void setSrcPortMask(String srcPortMask) { + this.srcPortMask = srcPortMask; + } + public String getDstIp() { + return dstIp; + } + public void setDstIp(String dstIp) { + this.dstIp = dstIp; + } + public String getDstIpMask() { + return dstIpMask; + } + public void setDstIpMask(String dstIpMask) { + this.dstIpMask = dstIpMask; + } + public String getDstPort() { + return dstPort; + } + public void setDstPort(String dstPort) { + this.dstPort = dstPort; + } + public String getDstPortMask() { + return dstPortMask; + } + public void setDstPortMask(String dstPortMask) { + this.dstPortMask = dstPortMask; + } + public Integer getDirection() { + return direction; + } + public void setDirection(Integer direction) { + this.direction = direction; + } + public Integer getProtocol() { + return protocol; + } + public void setProtocol(Integer protocol) { + this.protocol = protocol; + } + public Integer getIsValid() { + return isValid; + } + public void setIsValid(Integer isValid) { + this.isValid = isValid; + } + public Integer getIsAudit() { + return isAudit; + } + public void setIsAudit(Integer isAudit) { + this.isAudit = isAudit; + } + public SysUser getCreator() { + return creator; + } + public void setCreator(SysUser creator) { + this.creator = creator; + } + public Date getCreateTime() { + return createTime; + } + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + public SysUser getEditor() { + return editor; + } + public void setEditor(SysUser editor) { + this.editor = editor; + } + public Date getEditTime() { + return editTime; + } + public void setEditTime(Date editTime) { + this.editTime = editTime; + } + public SysUser getAuditor() { + return auditor; + } + public void setAuditor(SysUser auditor) { + this.auditor = auditor; + } + public Date getAuditTime() { + return auditTime; + } + public void setAuditTime(Date auditTime) { + this.auditTime = auditTime; + } + + + + public Date getBeginDate() { + return beginDate; + } + public void setBeginDate(Date beginDate) { + this.beginDate = beginDate; + } + public Date getEndDate() { + return endDate; + } + public void setEndDate(Date endDate) { + this.endDate = endDate; + } + public Date getEditBeginDate() { + return editBeginDate; + } + public void setEditBeginDate(Date editBeginDate) { + this.editBeginDate = editBeginDate; + } + public Date getEditEndDate() { + return editEndDate; + } + public void setEditEndDate(Date editEndDate) { + this.editEndDate = editEndDate; + } + public Date getAuditBeginDate() { + return auditBeginDate; + } + public void setAuditBeginDate(Date auditBeginDate) { + this.auditBeginDate = auditBeginDate; + } + public Date getAuditEndDate() { + return auditEndDate; + } + public void setAuditEndDate(Date auditEndDate) { + this.auditEndDate = auditEndDate; + } + /** + * 处理数据 + * @param list + * @param sourceList + * @param ParentId + * @param cascade + */ + @JsonIgnore + public static void sort(List list, List sourceList, Integer ParentId, boolean cascade){ + + } + + + + + + + +} diff --git a/src/main/java/com/nis/util/ConfigDictUtils.java b/src/main/java/com/nis/util/ConfigDictUtils.java index 25c2c1db9..8ce743a12 100644 --- a/src/main/java/com/nis/util/ConfigDictUtils.java +++ b/src/main/java/com/nis/util/ConfigDictUtils.java @@ -11,9 +11,11 @@ import com.nis.domain.SysDataDictionaryItem; import com.nis.domain.SysDataDictionaryName; import com.nis.domain.basics.ServiceDictInfo; import com.nis.domain.basics.SysDictInfo; +import com.nis.domain.specific.SpecificServiceCfg; import com.nis.web.dao.SysDictDao; import com.nis.web.dao.basics.ServiceDictInfoDao; import com.nis.web.dao.basics.SysDictInfoDao; +import com.nis.web.dao.specific.SpecificServiceCfgDao; import com.nis.web.service.SpringContextHolder; @@ -29,6 +31,7 @@ public class ConfigDictUtils { private final static ServiceDictInfoDao serviceDictInfoDao = SpringContextHolder.getBean(ServiceDictInfoDao.class); private final static SysDictInfoDao sysDictInfoDao = SpringContextHolder.getBean(SysDictInfoDao.class); + private final static SpecificServiceCfgDao specificServiceCfgDao = SpringContextHolder.getBean(SpecificServiceCfgDao.class); /** * 根据主键查询配置详情 @@ -47,6 +50,15 @@ public class ConfigDictUtils { public static SysDictInfo getSysDictInfoById(Integer sysDictId){ return sysDictInfoDao.getDictById(sysDictId); } + + /** + * 根据主键查询配置详情 + * @param sysDictId + * @return + */ + public static SpecificServiceCfg getBySpecServiceId(Integer specServiceId){ + return specificServiceCfgDao.getBySpecServiceId(specServiceId); + } /** * 根据计算公式计算数据结果 * @param sysDictId diff --git a/src/main/java/com/nis/web/controller/BaseController.java b/src/main/java/com/nis/web/controller/BaseController.java index efcecff49..f69a64dd9 100644 --- a/src/main/java/com/nis/web/controller/BaseController.java +++ b/src/main/java/com/nis/web/controller/BaseController.java @@ -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; /** * 管理基础路径 */ 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..1a38e57a2 100644 --- a/src/main/java/com/nis/web/controller/basics/SysDictInfoController.java +++ b/src/main/java/com/nis/web/controller/basics/SysDictInfoController.java @@ -76,77 +76,8 @@ public class SysDictInfoController extends BaseController { for(int i=0;i showTotalCount = sysDictInfoService.findAllDictSearchList(sysDictInfo,intArr); - model.addAttribute("showTotalCount", showTotalCount.size()); - - //查出顶层分页数据 - Page page = sysDictInfoService.findTopDictList(new Page(request, response), sysDictInfo,intArr); - //植入序号 - for(int i=0;i allList = sysDictInfoService.findAllDictList(); - //处理数据,保留顶层中的所有下层数据 - 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){ - 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 allList = sysDictInfoService.findAllDictSearchList(sysDictInfo,intArr); + if(sysDictInfo.getItemType()!=null){ + model.addAttribute("selectedType", sysDictInfo.getItemType()); + }else{ + model.addAttribute("selectedType", selectedType); + sysDictInfo.setItemType(selectedType); + } + Page pageCondition = new Page(request, response); + + //查询符合条件总数 + List allList = sysDictInfoService.findAllSysDictInfo(sysDictInfo,intArr,pageCondition.getOrderBy()); model.addAttribute("showTotalCount", allList.size()); - //查出条件查询顶层分页数据 - Page page = sysDictInfoService.findDictTopSearchList(new Page(request, response), sysDictInfo,intArr); + + //查出顶层分页数据 + Page page = sysDictInfoService.findTopDictList(pageCondition, sysDictInfo,intArr); //植入序号 for(int i=0;i intList = Lists.newArrayList(); + for(SysDictInfo se:page.getList()){ + if(se!=null){ + intList.add(se.getSysDictId()); + } + } + List 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()); - }*/ - - + 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 pageCondition = new Page(request, response); + // 取出所有符合条件的数据 + List allList = specificServiceCfgService.findAllSpecificServiceCfg(specificServiceCfg,pageCondition.getOrderBy()); + model.addAttribute("showTotalCount", allList.size()); + // 取出所有符合条件的顶层分页 + Page 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 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 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> treeData(@RequestParam(required=false) String extId,@RequestParam(required=false) String isShowHide, HttpServletResponse response){ + List> mapList = Lists.newArrayList(); + Map map2 = Maps.newHashMap(); + map2.put("id", 0); + map2.put("pId", 0); + map2.put("name","根节点"); + //map2.put("placeholder","0"); + mapList.add(map2); + List list = specificServiceCfgService.findAllSpecificServiceCfg(new SpecificServiceCfg(),""); + for (int i=0; i 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 list = specificServiceCfgService.getChildrenById(parent); + if(list==null||list.size()==0){ + return true; + }else{ + if(newIsLeaf==0){ + return true; + } + } + return false; + } + +} diff --git a/src/main/java/com/nis/web/controller/specific/SpecificServiceHostCfgController.java b/src/main/java/com/nis/web/controller/specific/SpecificServiceHostCfgController.java new file mode 100644 index 000000000..2b649b788 --- /dev/null +++ b/src/main/java/com/nis/web/controller/specific/SpecificServiceHostCfgController.java @@ -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 page = specificServiceHostCfgService.findSpecHostList(new Page(request, response), specificServiceHostCfg); + model.addAttribute("page", page); + //查出所有 + List list = specificServiceHostCfgService.getAll(); + List listSpecServiceId = Lists.newArrayList(); + List listSrcIp = Lists.newArrayList(); + List 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; + } +} 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/configuration/RequestInfoDao.xml b/src/main/java/com/nis/web/dao/configuration/RequestInfoDao.xml index aa64cb5cb..890f20906 100644 --- a/src/main/java/com/nis/web/dao/configuration/RequestInfoDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/RequestInfoDao.xml @@ -39,6 +39,7 @@ u.name AS editorName, r.edit_time AS editTime, e.name AS currentName, + e.name AS auditorName, r.audit_time AS auditTime, t.task_name AS taskName from request_info r @@ -46,7 +47,7 @@ left join sys_user u on r.editor_id=u.id left join sys_user e on r.auditor_id=e.id left join task_info t on r.task_id=t.id - where r.is_valid=1 and r.is_audit !=3 + where r.is_valid!=-1 and r.is_audit !=3 AND r.request_title like CONCAT('%',#{requestTitle}, '%') @@ -56,7 +57,8 @@ CONCAT('%',#{requestContent},'%') - AND r.request_number=#{requestNumber} + AND r.request_number like + CONCAT('%',#{requestNumber},'%') AND r.is_audit=${isAudit} @@ -65,9 +67,18 @@ AND r.request_time between #{beginDate} and #{endDate} - AND (r.create_time between #{dobeginDate} and #{doendDate}) or (r.audit_time between #{dobeginDate} and #{doendDate}) - - order by r.request_time desc + AND r.edit_time between #{dobeginDate} and #{doendDate} + + + + + ORDER BY ${page.orderBy} + + + ORDER BY r.create_time desc + + + @@ -98,31 +130,32 @@ editor_id, edit_time, auditor_id, - audit_time + audit_time, + task_id ) values (#{requestNumber,jdbcType=VARCHAR}, #{requestOrg,jdbcType=VARCHAR}, #{requestTime,jdbcType=DATE}, #{requestTitle,jdbcType=VARCHAR}, #{requestContent,jdbcType=VARCHAR}, #{isValid,jdbcType=INTEGER}, #{isAudit,jdbcType=INTEGER}, #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=DATE}, #{editorId,jdbcType=INTEGER}, #{editTime,jdbcType=DATE}, - #{auditorId,jdbcType=INTEGER}, #{auditTime,jdbcType=DATE}) + #{auditorId,jdbcType=INTEGER}, #{auditTime,jdbcType=DATE}, #{taskId,jdbcType=BIGINT}) update request_info - + request_number = #{requestNumber,jdbcType=VARCHAR}, - + request_org = #{requestOrg,jdbcType=VARCHAR}, request_time = #{requestTime,jdbcType=DATE}, - + request_title = #{requestTitle,jdbcType=VARCHAR}, - + request_content = #{requestContent,jdbcType=VARCHAR}, @@ -149,6 +182,9 @@ audit_time = #{auditTime,jdbcType=DATE}, + + task_id = #{taskId}, + where id = #{id,jdbcType=BIGINT} diff --git a/src/main/java/com/nis/web/dao/configuration/TaskInfoDao.xml b/src/main/java/com/nis/web/dao/configuration/TaskInfoDao.xml index 3e373d774..e64cd5a6b 100644 --- a/src/main/java/com/nis/web/dao/configuration/TaskInfoDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/TaskInfoDao.xml @@ -20,13 +20,14 @@ id, task_name, task_org, task_time, task_desc, is_valid, is_audit, creator_id, create_time, editor_id, edit_time, auditor_id, audit_time - + @@ -36,6 +37,7 @@ r.id AS id, r.task_name AS taskName, r.task_org AS taskOrg, + r.task_desc AS taskDesc, r.task_time AS taskTime, r.is_valid AS isValid, r.is_audit AS isAudit, @@ -43,13 +45,13 @@ r.create_time AS createTime, u.name AS editorName, r.edit_time AS editTime, - e.name AS currentName, + e.name AS auditorName, r.audit_time AS auditTime from task_info r left join sys_user s on r.creator_id=s.id left join sys_user u on r.editor_id=u.id left join sys_user e on r.auditor_id=e.id - where r.is_valid=1 and r.is_audit !=3 + where r.is_valid!=-1 and r.is_audit !=3 AND r.task_name like CONCAT('%',#{taskName}, '%') @@ -61,9 +63,16 @@ AND r.task_time between #{beginDate} and #{endDate} - AND (r.create_time between #{dobeginDate} and #{doendDate}) or (r.audit_time between #{dobeginDate} and #{doendDate}) + AND r.edit_time between #{dobeginDate} and #{doendDate} - order by r.task_time desc + + + ORDER BY ${page.orderBy} + + + ORDER BY r.create_time desc + + + select + from specific_service_cfg s where s.spec_service_id = #{specServiceId} + + + + + + + + + + + + insert into specific_service_cfg (spec_service_id,spec_service_name,spec_service_desc,is_valid, op_time, parent_id,is_leaf,group_id) + values(#{specServiceId},#{specServiceName},#{specServiceDesc},#{isValid},#{opTime},#{parent.specServiceId},#{isLeaf},#{groupId}) + + + + + UPDATE specific_service_cfg s SET + s.spec_service_id = #{specificServiceCfg.specServiceId}, + s.spec_service_name = #{specificServiceCfg.specServiceName}, + s.spec_service_desc = #{specificServiceCfg.specServiceDesc}, + s.is_valid = #{specificServiceCfg.isValid}, + s.op_time = #{specificServiceCfg.opTime}, + s.parent_id = #{specificServiceCfg.parent.specServiceId}, + s.is_leaf = #{specificServiceCfg.isLeaf}, + s.group_id = #{specificServiceCfg.groupId} + WHERE s.spec_service_id = #{oldId} + + + + + UPDATE specific_service_cfg s set s.is_valid = #{isValid} where s.spec_service_id = #{specServiceId} + + + + \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/specific/SpecificServiceHostCfgDao.java b/src/main/java/com/nis/web/dao/specific/SpecificServiceHostCfgDao.java new file mode 100644 index 000000000..e8aa88702 --- /dev/null +++ b/src/main/java/com/nis/web/dao/specific/SpecificServiceHostCfgDao.java @@ -0,0 +1,48 @@ +package com.nis.web.dao.specific; + +import java.util.List; + +import com.nis.domain.specific.SpecificServiceHostCfg; +import com.nis.web.dao.CrudDao; +import com.nis.web.dao.MyBatisDao; + + +@MyBatisDao +public interface SpecificServiceHostCfgDao extends CrudDao { + + /** + * 根据主键查询数据对象 + * @param hostId + * @return + */ + SpecificServiceHostCfg getByHostId(Integer hostId); + + /** + * 查询分页 + * @param specificServiceHostCfg + * @return + */ + List findSpecHostList(SpecificServiceHostCfg specificServiceHostCfg); + + /** + * 查出所有 + * @return + */ + List getAll(); + + /** + * 删除 + * @param hostId + */ + void delete(Integer hostId); + + /** + * 根据协议ID查询对象 + * @param specServiceId + * @return + */ + SpecificServiceHostCfg getBySpecServiceId(Integer specServiceId); + + + +} \ No newline at end of file diff --git a/src/main/java/com/nis/web/dao/specific/SpecificServiceHostCfgDao.xml b/src/main/java/com/nis/web/dao/specific/SpecificServiceHostCfgDao.xml new file mode 100644 index 000000000..0cf4fd69a --- /dev/null +++ b/src/main/java/com/nis/web/dao/specific/SpecificServiceHostCfgDao.xml @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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, + s.src_port_mask AS srcPortMask, + s.dst_ip AS dstIp, + s.dst_ip_mask AS dstIpMask, + s.dst_port AS dstPort, + s.dst_port_mask AS dstPortMask, + s.direction AS direction, + s.protocol AS protocol, + s.is_valid AS isValid, + s.is_audit AS isAudit, + s.creator_id AS "creator.id", + s.create_time AS createTime, + s.editor_id AS "editor.id", + s.edit_time AS editTime, + s.auditor_id AS "auditor.id", + s.audit_time AS 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}, + s.src_port_mask = #{srcPortMask}, + s.dst_ip = #{dstIp}, + s.dst_ip_mask = #{dstIpMask}, + s.dst_port = #{dstPort}, + s.dst_port_mask = #{dstPortMask}, + s.direction = #{direction}, + s.protocol = #{protocol}, + s.is_valid = #{isValid}, + s.is_audit = #{isAudit}, + s.creator_id = #{creator.id}, + s.create_time = #{createTime}, + s.editor_id = #{editor.id}, + s.edit_time = #{editTime}, + s.auditor_id = #{auditor.id}, + s.audit_time = #{auditTime} + where s.host_id = #{hostId} + + + + update specific_service_host_cfg s set + s.is_valid = 0 + where s.host_id = #{hostId} + + + + \ No newline at end of file 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/basics/TaskInfoService.java b/src/main/java/com/nis/web/service/basics/TaskInfoService.java index e4ebe5fb0..31e7b969b 100644 --- a/src/main/java/com/nis/web/service/basics/TaskInfoService.java +++ b/src/main/java/com/nis/web/service/basics/TaskInfoService.java @@ -36,12 +36,13 @@ public class TaskInfoService extends BaseService{ public void saveOrUpdate(TaskInfo taskInfo) { if (StringUtil.isEmpty(taskInfo.getId())) { //设置默认参数值 - taskInfo.setIsValid(1);//有效 + taskInfo.setIsValid(0);//无效 taskInfo.setIsAudit(0);//未审核 taskInfo.setCreatorId((UserUtils.getUser().getId()).intValue());//创建人员 taskInfo.setCreateTime(new Date());//创建时间 taskInfoDao.insert(taskInfo); }else{ + taskInfo.setIsAudit(0);//修改后状态为未审核 taskInfo.setEditorId((UserUtils.getUser().getId()).intValue());//修改人员 taskInfo.setEditTime(new Date());//修改时间 taskInfoDao.update(taskInfo); @@ -63,6 +64,7 @@ public class TaskInfoService extends BaseService{ for (int i = 0; i < exId.length; i++) { taskInfo.setId(Long.valueOf(exId[i])); taskInfo.setIsAudit(1);//审核通过 + taskInfo.setIsValid(1);//审核通过 taskInfo.setAuditTime(new Date()); taskInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员 taskInfoDao.update(taskInfo); @@ -85,6 +87,7 @@ public class TaskInfoService extends BaseService{ for (int i = 0; i < cancelId.length; i++) { taskInfo.setId(Long.valueOf(cancelId[i])); taskInfo.setIsAudit(3);//取消审核通过 + taskInfo.setIsValid(0); taskInfo.setAuditTime(new Date()); taskInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员 taskInfoDao.update(taskInfo); diff --git a/src/main/java/com/nis/web/service/configuration/RequestInfoService.java b/src/main/java/com/nis/web/service/configuration/RequestInfoService.java index f74bc07c5..47c997552 100644 --- a/src/main/java/com/nis/web/service/configuration/RequestInfoService.java +++ b/src/main/java/com/nis/web/service/configuration/RequestInfoService.java @@ -40,12 +40,13 @@ public class RequestInfoService extends BaseService{ public void saveOrUpdate(RequestInfo requestInfo) { if (StringUtil.isEmpty(requestInfo.getId())) { //设置默认参数值 - requestInfo.setIsValid(1);//有效 + requestInfo.setIsValid(0);//无效 requestInfo.setIsAudit(0);//未审核 requestInfo.setCreatorId((UserUtils.getUser().getId()).intValue());//创建人员 requestInfo.setCreateTime(new Date());//创建时间 requestInfoDao.insert(requestInfo); }else{ + requestInfo.setIsAudit(0);//修改后状态为未审核 requestInfo.setEditorId((UserUtils.getUser().getId()).intValue());//修改人员 requestInfo.setEditTime(new Date());//修改时间 requestInfoDao.update(requestInfo); @@ -67,6 +68,7 @@ public class RequestInfoService extends BaseService{ for (int i = 0; i < exId.length; i++) { requestInfo.setId(Long.valueOf(exId[i])); requestInfo.setIsAudit(1);//审核通过 + requestInfo.setIsValid(1);//审核通过有效 requestInfo.setAuditTime(new Date()); requestInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员 requestInfoDao.update(requestInfo); @@ -89,6 +91,7 @@ public class RequestInfoService extends BaseService{ for (int i = 0; i < cancelId.length; i++) { requestInfo.setId(Long.valueOf(cancelId[i])); requestInfo.setIsAudit(3);//取消审核通过 + requestInfo.setIsValid(0);//取消审核通过无效 requestInfo.setAuditTime(new Date()); requestInfo.setAuditorId((UserUtils.getUser().getId()).intValue());//审核人员 requestInfoDao.update(requestInfo); diff --git a/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java b/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java new file mode 100644 index 000000000..ebdb221e2 --- /dev/null +++ b/src/main/java/com/nis/web/service/specific/SpecificServiceCfgService.java @@ -0,0 +1,122 @@ +package com.nis.web.service.specific; + +import java.util.Date; +import java.util.List; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.beust.jcommander.internal.Lists; +import com.nis.domain.Page; +import com.nis.domain.specific.SpecificServiceCfg; +import com.nis.util.StringUtil; +import com.nis.web.dao.specific.SpecificServiceCfgDao; +import com.nis.web.service.BaseService; + +@Service +public class SpecificServiceCfgService extends BaseService{ + + @Autowired + private SpecificServiceCfgDao specificServiceCfgDao; + + /** + * 根据id查询对象 + * @param specServiceId + * @return + */ + public SpecificServiceCfg getBySpecServiceId(Integer specServiceId) { + return specificServiceCfgDao.getBySpecServiceId(specServiceId); + } + /** + * 查询所有符合条件的顶层分页 + * @param page + * @param specificServiceCfg + * @return + */ + public Page findTopPage(Page page, SpecificServiceCfg specificServiceCfg){ + // 设置分页参数 + specificServiceCfg.setPage(page); + // 执行分页查询 + List list = Lists.newArrayList(); + list = specificServiceCfgDao.findTopPage(specificServiceCfg); + SpecificServiceCfg ss = new SpecificServiceCfg(); + ss.setSpecServiceId(0); + for(SpecificServiceCfg ssc:list){ + ssc.setParent(ss); + } + page.setList(list); + return page; + } + /** + * 查询所有符合条件的数据 + * @param specificServiceCfg + * @return + */ + 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()); + specificServiceCfgDao.insert(specificServiceCfg); + }else{//修改 + specificServiceCfg.setOpTime(new Date()); + //修改id则将其子类的parent_id一并修改 + if(oldId!=specificServiceCfg.getSpecServiceId()){ + //找出所有子类 + List list = specificServiceCfgDao.getChildrenById(oldId); + SpecificServiceCfg se =new SpecificServiceCfg(); + se.setSpecServiceId(specificServiceCfg.getSpecServiceId()); + for(SpecificServiceCfg ss:list){ + if(ss!=null){ + ss.setParent(se); + specificServiceCfgDao.update(ss,ss.getSpecServiceId()); + } + } + } + specificServiceCfgDao.update(specificServiceCfg,oldId); + } + } + /** + * 删除 + * @param specificServiceCfg + */ + public void delete(String mulitId) { + String[] ids = mulitId.split(","); + for(String id:ids){ + if (!id.equals("")) { + SpecificServiceCfg specificServiceCfg = specificServiceCfgDao.getBySpecServiceId(Integer.valueOf(id)); + List list = Lists.newArrayList(); + //找出所有下级 + if(specificServiceCfg!=null){ + SpecificServiceCfg.sortList(list, specificServiceCfgDao.findAllSpecificServiceCfg(new SpecificServiceCfg(),""), specificServiceCfg.getSpecServiceId(), true); + list.add(specificServiceCfg); + for(SpecificServiceCfg ss:list){ + ss.setIsValid(0); + specificServiceCfgDao.delete(ss); + } + } + } + } + } + + /** + * 根据specServiceId查询所有下级 + * @param specServiceId + * @return + */ + public List getChildrenById(Integer specServiceId) { + return specificServiceCfgDao.getChildrenById(specServiceId); + } + + + +} diff --git a/src/main/java/com/nis/web/service/specific/SpecificServiceHostCfgService.java b/src/main/java/com/nis/web/service/specific/SpecificServiceHostCfgService.java new file mode 100644 index 000000000..ce788064f --- /dev/null +++ b/src/main/java/com/nis/web/service/specific/SpecificServiceHostCfgService.java @@ -0,0 +1,110 @@ +package com.nis.web.service.specific; + +import java.util.Date; +import java.util.List; + +import org.apache.commons.lang.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.nis.domain.Page; +import com.nis.domain.SysUser; +import com.nis.domain.specific.SpecificServiceHostCfg; +import com.nis.web.dao.specific.SpecificServiceHostCfgDao; +import com.nis.web.security.UserUtils; +import com.nis.web.service.BaseService; + +@Service +public class SpecificServiceHostCfgService extends BaseService{ + + @Autowired + private SpecificServiceHostCfgDao specificServiceHostCfgDao; + + /** + * 根据主键查询数据对象 + * @param hostId + * @return + */ + public SpecificServiceHostCfg getDictByHostId(Integer hostId) { + return specificServiceHostCfgDao.getByHostId(hostId); + } + + /** + * 查出分页 + * @param page + * @param specificServiceHostCfg + * @return + */ + public Page findSpecHostList(Page page, + SpecificServiceHostCfg specificServiceHostCfg) { + specificServiceHostCfg.setPage(page); + page.setList(specificServiceHostCfgDao.findSpecHostList(specificServiceHostCfg)); + return page; + } + + /** + * 新增或修改 + * @param specificServiceHostCfg + */ + public void saveOrUpdate(SpecificServiceHostCfg specificServiceHostCfg) { + SysUser user = UserUtils.getUser(); + Date date = new Date(); + if(specificServiceHostCfg.getHostId()==null){//新增 + specificServiceHostCfg.setIsValid(1); + specificServiceHostCfg.setCreator(user); + 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.setAuditor(user); + specificServiceHostCfg.setAuditTime(date); + }*/ + specificServiceHostCfg.setEditor(user); + specificServiceHostCfg.setEditTime(date); + specificServiceHostCfg.setAuditor(user); + specificServiceHostCfg.setAuditTime(date); + specificServiceHostCfgDao.update(specificServiceHostCfg); + } + } + + /** + * 查出所有 + * @return + */ + public List getAll() { + + return specificServiceHostCfgDao.getAll(); + } + + /** + * 删除 + * @param mulitId + */ + public void delete(String mulitId) { + String[] ids = mulitId.split(","); + for(String hostId:ids){ + if (!StringUtils.isEmpty(hostId)) { + specificServiceHostCfgDao.delete(Integer.valueOf(hostId)); + } + } + } + + /** + * 根据协议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 10baf8b7c..5c7b33fbe 100644 --- a/src/main/resources/messages/message_en.properties +++ b/src/main/resources/messages/message_en.properties @@ -11,7 +11,7 @@ officeManage=office management userManage=user management notify=my notify help=help -home=home +home=Home panel=my panel userInfo=personal information updatePwd=update password @@ -95,6 +95,7 @@ log_search=log search sysService_manage=system service manage service_manage=service type manage system_service_manage=system service type manage +specific_service_cfg=specific service cfg #============menu end====================== #============yewu begin====================== @@ -172,6 +173,12 @@ has_approved=It has been approved and can not be operated on ! hasnot_approved=It has not been approved and can not be operated on ! check_one=choose one please ! one_more=please choose at least one ! +custom_columns=custom columns +maxlength_64=The maxlength is 64\uff01 +maxlength_128=The maxlength is 128\uff01 +maxlength_256=The maxlength is 256\uff01 +maxlength_512=The maxlength is 512\uff01 +maxlength_4000=The maxlength is 4000\uff01 #==========message end===================== #==========yewuliexingguanli begin===================== diff --git a/src/main/resources/messages/message_ru.properties b/src/main/resources/messages/message_ru.properties index 10baf8b7c..1d61153f8 100644 --- a/src/main/resources/messages/message_ru.properties +++ b/src/main/resources/messages/message_ru.properties @@ -11,7 +11,7 @@ officeManage=office management userManage=user management notify=my notify help=help -home=home +home=Home panel=my panel userInfo=personal information updatePwd=update password @@ -95,6 +95,7 @@ log_search=log search sysService_manage=system service manage service_manage=service type manage system_service_manage=system service type manage +specific_service_cfg=specific service 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 7b93af1a8..a50c12ec3 100644 --- a/src/main/resources/messages/message_zh_CN.properties +++ b/src/main/resources/messages/message_zh_CN.properties @@ -11,7 +11,7 @@ officeManage=\u673a\u6784\u7ba1\u7406 userManage=\u7528\u6237\u7ba1\u7406 notify=\u6211\u7684\u540c\u5fd7 help=\u5173\u4e8e\u5e2e\u52a9 -home=\u5b98\u65b9\u9996\u9875 +home=\u9996\u9875 panel=\u6211\u7684\u9762\u677f userInfo=\u4e2a\u4eba\u4fe1\u606f updatePwd=\u4fee\u6539\u5bc6\u7801 @@ -95,6 +95,7 @@ text_monitor=\u6587\u672c\u5e38\u89c4\u76d1\u6d4b 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 #==========menu end===================== #==========yewu zidian begin===================== @@ -106,7 +107,7 @@ desc=\u63cf\u8ff0\u4fe1\u606f parent_id=\u7236ID is_leaf=\u662f\u5426\u53f6\u5b50\u8282\u70b9 is_valid=\u6709\u6548\u6807\u5fd7 -create_time=\u914d\u7f6e\u65f6\u95f4 +create_time=\u521b\u5efa\u65f6\u95f4 edit_time=\u4fee\u6539\u65f6\u95f4 superior_config=\u4e0a\u7ea7\u914d\u7f6e config_content=\u914d\u7f6e\u5185\u5bb9 @@ -171,6 +172,12 @@ has_approved=\u5df2\u7ecf\u901a\u8fc7\u5ba1\u6838\uff0c\u65e0\u6cd5\u8fdb\u884c\ hasnot_approved=\u672a\u901a\u8fc7\u5ba1\u6838\uff0c\u65e0\u6cd5\u8fdb\u884c\u8be5\u64cd\u4f5c\uff01 check_one=\u8bf7\u9009\u62e9\u4e00\u6761\u6570\u636e\uff01 one_more=\u8bf7\u81f3\u5c11\u9009\u62e9\u4e00\u6761\u6570\u636e! +custom_columns=\u81ea\u5b9a\u4e49\u5217\u5b57\u6bb5 +maxlength_64=\u8bf7\u8f93\u5165\u4e00\u4e2a\u957f\u5ea6\u6700\u591a\u662f 64\u7684\u5b57\u7b26\u4e32\uff01 +maxlength_128=\u8bf7\u8f93\u5165\u4e00\u4e2a\u957f\u5ea6\u6700\u591a\u662f 128\u7684\u5b57\u7b26\u4e32\uff01 +maxlength_256=\u8bf7\u8f93\u5165\u4e00\u4e2a\u957f\u5ea6\u6700\u591a\u662f256\u7684\u5b57\u7b26\u4e32\uff01 +maxlength_512=\u8bf7\u8f93\u5165\u4e00\u4e2a\u957f\u5ea6\u6700\u591a\u662f512\u7684\u5b57\u7b26\u4e32\uff01 +maxlength_4000=\u8bf7\u8f93\u5165\u4e00\u4e2a\u957f\u5ea6\u6700\u591a\u662f4000\u7684\u5b57\u7b26\u4e32\uff01 #==========message end===================== #==========yewuliexingguanli begin===================== diff --git a/src/main/webapp/WEB-INF/include/form/complexInfo.jsp b/src/main/webapp/WEB-INF/include/form/complexInfo.jsp index fe92d2b0f..c0c328a9a 100644 --- a/src/main/webapp/WEB-INF/include/form/complexInfo.jsp +++ b/src/main/webapp/WEB-INF/include/form/complexInfo.jsp @@ -11,7 +11,7 @@
- + <%--
@@ -20,10 +20,8 @@
- - -
-
+
--%> +
@@ -32,42 +30,6 @@
- - <%--
-
- -
- - -
-
-
--%> -
-
- -
- - - <%-- --%> -
-
-
-
@@ -116,6 +78,27 @@
+
+
+ +
+ + + <%-- --%> +
+
+
+
+ +
diff --git a/src/main/webapp/WEB-INF/include/form/ipInfo.jsp b/src/main/webapp/WEB-INF/include/form/ipInfo.jsp index 7886da9a8..d7a425267 100644 --- a/src/main/webapp/WEB-INF/include/form/ipInfo.jsp +++ b/src/main/webapp/WEB-INF/include/form/ipInfo.jsp @@ -105,89 +105,103 @@
-
-
-
- -
- - <%-- --%> -
-
-
-
-
-
- -
- - <%-- --%> -
-
-
-
-
-<%--
-
-
- -
- -
-
-
-
-
-
-
- - -
-
-
- --%> -
-
-
- -
- - - <%-- --%> -
-
-
-
-
-
- -
- -
-
-
-
-
+ + + + + + + +
+
+
+ +
+ +
+
+
+
+
+
+ +
+ + <%-- --%> +
+
+
+
+
+ + +
+ +
+
+
+ +
+ + <%-- --%> +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+ +
+ + + <%-- --%> +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/include/form/stringInfo.jsp b/src/main/webapp/WEB-INF/include/form/stringInfo.jsp index 90684fdd8..ec8061d3b 100644 --- a/src/main/webapp/WEB-INF/include/form/stringInfo.jsp +++ b/src/main/webapp/WEB-INF/include/form/stringInfo.jsp @@ -21,101 +21,93 @@ -
-
-
- -
- - <%-- --%> -
-
-
-
-
-
- -
- - - <%-- --%> -
-
-
-
-
-
-
-
- -
- - -
-
-
-
-
-
- -
- -
-
-
-
-
-
-
-
- -
- -
-
-
- -
-
-
- -
- -
-
-
-
-
+ + + + + + + + +
+
+
+ +
+ + +
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+ + + <%-- --%> +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+
\ No newline at end of file diff --git a/src/main/webapp/WEB-INF/include/header.jsp b/src/main/webapp/WEB-INF/include/header.jsp index 44ba82c87..b4d8c9f50 100644 --- a/src/main/webapp/WEB-INF/include/header.jsp +++ b/src/main/webapp/WEB-INF/include/header.jsp @@ -1,3 +1,4 @@ +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> @@ -47,6 +48,10 @@ + + + + @@ -62,4 +67,17 @@ - + + + + + + + + + + + + + + diff --git a/src/main/webapp/WEB-INF/include/left_menu.jsp b/src/main/webapp/WEB-INF/include/left_menu.jsp index 071075475..682412d8e 100644 --- a/src/main/webapp/WEB-INF/include/left_menu.jsp +++ b/src/main/webapp/WEB-INF/include/left_menu.jsp @@ -7,16 +7,17 @@