From 5913fc6e4ff37d49b2d8de351ea35dfb62c2538e Mon Sep 17 00:00:00 2001 From: wangxin Date: Sat, 2 Jun 2018 17:40:14 +0800 Subject: [PATCH] =?UTF-8?q?(1)ip=E7=AE=A1=E6=8E=A7=E6=8F=90=E4=BA=A4=20(2)?= =?UTF-8?q?delRow.tag=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E5=B0=86=E7=BC=96=E8=AF=91ID?= =?UTF-8?q?=E4=B9=9F=E4=BC=A0=E8=BF=87=E5=8E=BB=20(3)=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E4=BF=AE=E6=94=B9=EF=BC=8C=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E5=BA=94=E5=BD=93=E6=98=AFput=E8=AF=B7=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/nis/util/ConfigServiceUtil.java | 2 +- .../configuration/ntc/IpController.java | 103 ++++++ .../ntc/WhiteListController.java | 11 +- .../nis/web/dao/configuration/IpCfgDao.xml | 2 +- .../java/com/nis/web/service/CrudService.java | 4 +- .../ComplexStringCfgService.java | 4 +- .../service/configuration/IpCfgService.java | 180 ++++++++-- .../configuration/MultipleCfgService.java | 4 +- .../service/configuration/NumCfgService.java | 4 +- .../configuration/StringCfgService.java | 4 +- src/main/webapp/WEB-INF/tags/sys/delRow.tag | 12 +- .../webapp/WEB-INF/views/cfg/iplist/form.jsp | 119 +++++++ .../webapp/WEB-INF/views/cfg/iplist/list.jsp | 322 ++++++++++++++++++ .../WEB-INF/views/cfg/whitelist/ipForm.jsp | 2 +- 14 files changed, 731 insertions(+), 42 deletions(-) create mode 100644 src/main/java/com/nis/web/controller/configuration/ntc/IpController.java create mode 100644 src/main/webapp/WEB-INF/views/cfg/iplist/form.jsp create mode 100644 src/main/webapp/WEB-INF/views/cfg/iplist/list.jsp diff --git a/src/main/java/com/nis/util/ConfigServiceUtil.java b/src/main/java/com/nis/util/ConfigServiceUtil.java index 54cb1c039..c72ab7a66 100644 --- a/src/main/java/com/nis/util/ConfigServiceUtil.java +++ b/src/main/java/com/nis/util/ConfigServiceUtil.java @@ -255,7 +255,7 @@ public class ConfigServiceUtil { WebTarget wt = ClientUtil.getWebTarger(url); //获取响应结果 Builder header = wt.request(MediaType.APPLICATION_JSON).header("Content-Type", MediaType.APPLICATION_JSON); - Response response= header.post(Entity.entity(params, MediaType.APPLICATION_JSON)); + Response response= header.put(Entity.entity(params, MediaType.APPLICATION_JSON)); if( response.getStatus() == 200){ result= response.readEntity(String.class); JSONObject resObject = JSONObject.fromObject(result); diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java b/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java new file mode 100644 index 000000000..cdf52c483 --- /dev/null +++ b/src/main/java/com/nis/web/controller/configuration/ntc/IpController.java @@ -0,0 +1,103 @@ +package com.nis.web.controller.configuration.ntc; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.lang3.StringUtils; +import org.apache.shiro.authz.annotation.Logical; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.BeanUtils; +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.servlet.mvc.support.RedirectAttributes; + +import com.nis.domain.Page; +import com.nis.domain.configuration.AreaIpCfg; +import com.nis.domain.configuration.BaseIpCfg; +import com.nis.domain.configuration.IpPortCfg; +import com.nis.util.Constants; +import com.nis.web.controller.BaseController; + +/** + * IP相关配置控制类 + * @author dell + * + */ +@Controller +@RequestMapping("${adminPath}/ntc/iplist") +public class IpController extends BaseController{ + @RequestMapping(value = {"list"}) + @RequiresPermissions(value={"iplist:config","iplist:audit"},logical=Logical.OR) + public String list(Model model,@ModelAttribute("cfg")IpPortCfg cfg,HttpServletRequest request,HttpServletResponse response) { + cfg.setTableName(IpPortCfg.getTablename()); + Page searchPage=new Page(request,response,"r"); + Page page = ipCfgService.findPage(searchPage, cfg); + model.addAttribute("page", page); + initPageCondition(model,cfg); + return "/cfg/iplist/list"; + } + @RequestMapping(value = {"form"}) + @RequiresPermissions(value={"iplist:config"}) + public String form(Model model,String ids,BaseIpCfg entity) { + if(StringUtils.isNotBlank(ids)){ + entity = ipCfgService.getIpCfgById(IpPortCfg.getTablename(),Long.parseLong(ids)); + } + if(entity.getCfgId()!=null){ + List areaCfg=ipCfgService.getListByComileId(AreaIpCfg.getTablename(), String.valueOf(entity.getCompileId())); + model.addAttribute("areaCfgs", areaCfg); + model.addAttribute("_cfg", entity); + initUpdateFormCondition(model,entity); + }else{ + IpPortCfg cfg=new IpPortCfg(); + cfg.initDefaultValueImpl(); + cfg.setFunctionId(entity.getFunctionId()); + cfg.setProtocolId(entity.getProtocolId()); + model.addAttribute("_cfg", cfg); + initFormCondition(model,entity); + } + + return "/cfg/iplist/form"; + } + @RequestMapping(value = {"saveOrUpdate"}) + public String saveOrUpdate(RedirectAttributes model, IpPortCfg cfg) { + Date date=new Date(); + cfg.setTableName(IpPortCfg.getTablename()); + logger.info("saveOrUpdateIp loaded"); + try{ + cfg.setIsValid(Constants.VALID_NO); + cfg.setIsAudit(Constants.AUDIT_NOT_YET); + if(cfg.getCfgId()==null){//新增 + cfg.setCreatorId(cfg.getCurrentUser().getId()); + cfg.setCreateTime(date); + ipCfgService.addIpCfg(cfg); + }else{//修改 + cfg.setEditorId(cfg.getCurrentUser().getId()); + cfg.setEditTime(new Date()); + ipCfgService.updateIpCfg(cfg); + } + addMessage(model,"save_success"); + }catch(Exception e){ + logger.error("保存失败",e); + addMessage(model,"save_failed"); + } + return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+cfg.getFunctionId(); + } + @RequestMapping(value = {"delete"}) + @RequiresPermissions("iplist:config") + public String delete(String ids,String compileIds,Integer functionId,RedirectAttributes model) { + try{ + ipCfgService.deleteIp(ids,compileIds,functionId.intValue()); + addMessage(model,"delete_success"); + }catch(Exception e){ + logger.error("删除失败", e); + addMessage(model,"delete_failed"); + } + return "redirect:" + adminPath +"/ntc/iplist/list?functionId="+functionId; + } +} diff --git a/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java b/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java index a4b6f9cc6..1d08a3c49 100644 --- a/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java +++ b/src/main/java/com/nis/web/controller/configuration/ntc/WhiteListController.java @@ -20,13 +20,8 @@ import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.BaseStringCfg; import com.nis.domain.configuration.HttpUrlCfg; import com.nis.domain.configuration.IpPortCfg; -import com.nis.domain.maat.ToMaatResult; -import com.nis.exceptions.MaatConvertException; -import com.nis.util.ConfigServiceUtil; import com.nis.util.Constants; import com.nis.web.controller.BaseController; -import com.nis.web.dao.configuration.IpCfgDao; -import com.nis.web.dao.configuration.StringCfgDao; /** * 白名单 @@ -105,11 +100,11 @@ public class WhiteListController extends BaseController{ if(cfg.getCfgId()==null){//新增 cfg.setCreatorId(cfg.getCurrentUser().getId()); cfg.setCreateTime(date); - ipCfgService.addIpCfg((BaseIpCfg)cfg,null); + ipCfgService.addIpCfg(cfg); }else{//修改 cfg.setEditorId(cfg.getCurrentUser().getId()); cfg.setEditTime(new Date()); - ipCfgService.updateIpCfg((BaseIpCfg)cfg,null,null,null); + ipCfgService.updateIpCfg(cfg); } addMessage(model,"save_success"); }catch(Exception e){ @@ -147,7 +142,7 @@ public class WhiteListController extends BaseController{ @RequiresPermissions("whitelist:config") public String deleteIp(String ids,Integer functionId,RedirectAttributes model) { try{ - ipCfgService.deleteWhiteIp(ids); + ipCfgService.deleteIp(ids,null,functionId.intValue()); addMessage(model,"delete_success"); }catch(Exception e){ logger.error("删除失败", e); diff --git a/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml b/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml index 032759933..0a3f805f9 100644 --- a/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml +++ b/src/main/java/com/nis/web/dao/configuration/IpCfgDao.xml @@ -501,7 +501,7 @@ lable = #{lable,jdbcType=VARCHAR}, - area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR} + area_effective_ids = #{areaEffectiveIds,jdbcType=VARCHAR}, FUNCTION_ID=#{functionId,jdbcType=INTEGER} diff --git a/src/main/java/com/nis/web/service/CrudService.java b/src/main/java/com/nis/web/service/CrudService.java index f0e9839e0..e4cedf80f 100644 --- a/src/main/java/com/nis/web/service/CrudService.java +++ b/src/main/java/com/nis/web/service/CrudService.java @@ -126,13 +126,13 @@ public abstract class CrudService, T extends BaseEntity> * @exception * @since 1.0.0 */ - public void saveIpBatch(List areaIpCfgs) { + public void saveIpBatch(List areaIpCfgs) { SqlSessionFactory sqlSessionFactory=SpringContextHolder.getBean(SqlSessionFactory.class); SqlSession batchSqlSession = null; try{ batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, false); for(int index = 0; index < areaIpCfgs.size();index++){ - BaseIpCfg t = areaIpCfgs.get(index); + AreaIpCfg t = areaIpCfgs.get(index); ((CrudDao) batchSqlSession.getMapper(IpCfgDao.class)).insert(t); } batchSqlSession.commit(); diff --git a/src/main/java/com/nis/web/service/configuration/ComplexStringCfgService.java b/src/main/java/com/nis/web/service/configuration/ComplexStringCfgService.java index 8133e2751..237134703 100644 --- a/src/main/java/com/nis/web/service/configuration/ComplexStringCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/ComplexStringCfgService.java @@ -38,7 +38,7 @@ public class ComplexStringCfgService extends CrudService areaIpCfgs){ if(areaIpCfgs!=null&&areaIpCfgs.size()>0){ - this.saveIpBatch(areaIpCfgs); +// this.saveIpBatch(areaIpCfgs); } return complexStringCfgDao.insert(cfg); } @@ -55,7 +55,7 @@ public class ComplexStringCfgService extends CrudService addAreaCfg,List updateAreaCfg,List deleteAreaCfgs){ if(addAreaCfg!=null&&addAreaCfg.size()>0){ - this.saveIpBatch(addAreaCfg); +// this.saveIpBatch(addAreaCfg); } if(updateAreaCfg!=null&&updateAreaCfg.size()>0){ this.updateIpBatch(updateAreaCfg); diff --git a/src/main/java/com/nis/web/service/configuration/IpCfgService.java b/src/main/java/com/nis/web/service/configuration/IpCfgService.java index 0c0248e80..0cd5e7774 100644 --- a/src/main/java/com/nis/web/service/configuration/IpCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/IpCfgService.java @@ -11,6 +11,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import com.nis.domain.configuration.AreaBean; import com.nis.domain.configuration.AreaIpCfg; import com.nis.domain.configuration.BaseIpCfg; import com.nis.domain.configuration.IpPortCfg; @@ -52,10 +53,10 @@ public class IpCfgService extends CrudService { * @since 1.0.0 */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public int addIpCfg(BaseIpCfg baseIpCfg,List areaIpCfgs){ - if(areaIpCfgs!=null&&areaIpCfgs.size()>0){ - this.saveIpBatch(areaIpCfgs); - } + public void addIpCfg(BaseIpCfg cfg){ + //区域IPsetAreaEffectiveIds设置 + List areaCfg=cfg.getAreaCfg(); + List areaIsps=cfg.getAreaIsp(); //调用服务接口获取compileId Integer compileId = 0; try { @@ -69,12 +70,71 @@ public class IpCfgService extends CrudService { throw new MaatConvertException(":"+e.getMessage()); } if(compileId!=0){ - baseIpCfg.setCompileId(compileId); - return ipCfgDao.insert(baseIpCfg); + cfg.setCompileId(compileId); + if(Constants.IS_AREA_EFFECTIVE_NO==cfg.getIsAreaEffective()){ + cfg.setAreaEffectiveIds("0"); + cfg.setAreaType(null); + }else if(Constants.IS_AREA_EFFECTIVE_YES==cfg.getIsAreaEffective()){ + if(Constants.AREA_EFFECTIVE_TYPE_AREA_ISP==cfg.getAreaType()&&areaIsps!=null&&areaIsps.size()>0){ + StringBuffer areaEffectiveIds=new StringBuffer(); + for(int i=0;i0){ + cfg.setAreaEffectiveIds("0"); + } + if(areaCfg!=null&&areaCfg.size()>0){ + for(AreaIpCfg c:cfg.getAreaCfg()){ + c.initDefaultValue(); + BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction", + "protocol","protocolId","areaEffectiveIds","cfgRegionCode", + "cfgType","ipPattern","srcIpAddress","portPattern","srcPort","destIpAddress","destPort"}); + c.setTableName(AreaIpCfg.getTablename()); + } + this.saveIpBatch(cfg.getAreaCfg()); + } + } + + ipCfgDao.insert(cfg); }else{ throw new MaatConvertException(""); } + } + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void addIpCfg(BaseIpCfg baseIpCfg,List areaIpCfgs){ +// if(areaIpCfgs!=null&&areaIpCfgs.size()>0){ +// this.saveIpBatch(areaIpCfgs); +// } +// //调用服务接口获取compileId +// Integer compileId = 0; +// try { +// List compileIds = ConfigServiceUtil.getId(1,1); +// if(!StringUtil.isEmpty(compileIds)){ +// compileId = compileIds.get(0); +// } +// } catch (Exception e) { +// e.printStackTrace(); +// logger.info("获取编译ID出错"); +// throw new MaatConvertException(":"+e.getMessage()); +// } +// if(compileId!=0){ +// baseIpCfg.setCompileId(compileId); +// return ipCfgDao.insert(baseIpCfg); +// }else{ +// throw new MaatConvertException(""); +// } + } /** * @@ -87,17 +147,71 @@ public class IpCfgService extends CrudService { * @since 1.0.0 */ @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public int updateIpCfg(BaseIpCfg baseIpCfg,List addAreaCfg,List updateAreaCfg,List deleteAreaCfgs){ - if(addAreaCfg!=null&&addAreaCfg.size()>0){ - this.saveIpBatch(addAreaCfg); + public void updateIpCfg(BaseIpCfg cfg){ + AreaIpCfg area=new AreaIpCfg(); + area.setCompileId(cfg.getCompileId()); + area.setFunctionId(cfg.getFunctionId()); + areaIpCfgDao.deleteAreaIpCfg(area); + //区域IPsetAreaEffectiveIds设置 + List areaCfg=cfg.getAreaCfg(); + List areaIsps=cfg.getAreaIsp(); + if(Constants.IS_AREA_EFFECTIVE_NO==cfg.getIsAreaEffective()){ + cfg.setAreaEffectiveIds("0"); + cfg.setAreaType(null); + }else if(Constants.IS_AREA_EFFECTIVE_YES==cfg.getIsAreaEffective()){ + if(Constants.AREA_EFFECTIVE_TYPE_AREA_ISP==cfg.getAreaType()&&areaIsps!=null&&areaIsps.size()>0){ + StringBuffer areaEffectiveIds=new StringBuffer(); + for(int i=0;i0){ + cfg.setAreaEffectiveIds("0"); + } + if(areaCfg!=null&&areaCfg.size()>0){ + for(AreaIpCfg c:cfg.getAreaCfg()){ + c.initDefaultValue(); + BeanUtils.copyProperties(cfg, c,new String[]{"cfgId","ipType","direction", + "protocol","protocolId","areaEffectiveIds","cfgRegionCode", + "cfgType","ipPattern","srcIpAddress","portPattern","srcPort","destIpAddress","destPort"}); + c.setTableName(AreaIpCfg.getTablename()); + } + this.saveIpBatch(cfg.getAreaCfg()); + } } - if(updateAreaCfg!=null&&updateAreaCfg.size()>0){ - this.updateIpBatch(updateAreaCfg); - } - if(deleteAreaCfgs!=null&&deleteAreaCfgs.size()>0){ - this.deleteIpBatch(deleteAreaCfgs); - } - return ipCfgDao.update(baseIpCfg); + ipCfgDao.update(cfg); + } + /** + * + * updateIpCfg(更新IP类配置) + * (继承BaseIpCfg这个类方可使用) + * @param baseIpCfg + * @return + *int + * @exception + * @since 1.0.0 + */ + @Transactional(readOnly=false,rollbackFor=RuntimeException.class) + public void updateIpCfg(BaseIpCfg baseIpCfg,List addAreaCfg,List updateAreaCfg,List deleteAreaCfgs){ +// if(addAreaCfg!=null&&addAreaCfg.size()>0){ +// this.saveIpBatch(addAreaCfg); +// } +// if(updateAreaCfg!=null&&updateAreaCfg.size()>0){ +// this.updateIpBatch(updateAreaCfg); +// } +// if(deleteAreaCfgs!=null&&deleteAreaCfgs.size()>0){ +// this.deleteIpBatch(deleteAreaCfgs); +// } +// return ipCfgDao.update(baseIpCfg); } public void auditWhiteIp(BaseIpCfg cfg) throws Exception{ List beans=new ArrayList<>(); @@ -160,11 +274,11 @@ public class IpCfgService extends CrudService { maatBean.setVersion(Constants.MAAT_VERSION); maatBean.setOpAction(Constants.UPDATE_ACTION); //调用服务接口取消配置 - String json=gsonToJson(beans); + String json=gsonToJson(maatBean); logger.info("IP白名单配置参数:"+json); //调用服务接口取消配置 try { - ToMaatResult result = ConfigServiceUtil.put(json, 2); + ToMaatResult result = ConfigServiceUtil.put(json, 1); logger.info("IP白名单取消配置响应信息:"+result.getMsg()); } catch (Exception e) { e.printStackTrace(); @@ -250,8 +364,36 @@ public class IpCfgService extends CrudService { } } +// @Transactional(readOnly=false,rollbackFor=RuntimeException.class) +// public void deleteWhiteIp(String ids){ +// List ipCfgs=new ArrayList(); +// Date date =new Date(); +// if(StringUtils.isNotBlank(ids)){ +// for(String idStr:ids.split(",")){ +// if(StringUtils.isNotBlank(idStr)){ +// BaseIpCfg cfg=new BaseIpCfg(); +// cfg.setCfgId(Long.parseLong(idStr)); +// cfg.setTableName(IpPortCfg.getTablename()); +// cfg.setEditorId(cfg.getCurrentUser().getId()); +// cfg.setEditTime(date); +// cfg.setIsValid(Constants.VALID_DEL); +// ipCfgs.add(cfg); +// } +// } +// } +// this.deleteBatch(ipCfgs, IpCfgDao.class); +// } @Transactional(readOnly=false,rollbackFor=RuntimeException.class) - public void deleteWhiteIp(String ids){ + public void deleteIp(String ids,String compileIds,int functionId){ + if(StringUtils.isNotBlank(compileIds)){ + for(String compileId:compileIds.split(",")){ + AreaIpCfg area=new AreaIpCfg(); + area.setCompileId(Integer.parseInt(compileId)); + area.setFunctionId(functionId); + area.setIsValid(Constants.VALID_DEL); + areaIpCfgDao.updateValid(area); + } + } List ipCfgs=new ArrayList(); Date date =new Date(); if(StringUtils.isNotBlank(ids)){ diff --git a/src/main/java/com/nis/web/service/configuration/MultipleCfgService.java b/src/main/java/com/nis/web/service/configuration/MultipleCfgService.java index a0d893073..41ee39a06 100644 --- a/src/main/java/com/nis/web/service/configuration/MultipleCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/MultipleCfgService.java @@ -81,7 +81,7 @@ public class MultipleCfgService extends CrudService0){ List areaCfg=new ArrayList<>(); areaCfg.addAll(cfg.getAreaCfg()); - this.saveIpBatch(areaCfg); +// this.saveIpBatch(areaCfg); } } @@ -138,7 +138,7 @@ public class MultipleCfgService extends CrudService0){ - this.saveIpBatch(addAreaCfg); +// this.saveIpBatch(addAreaCfg); } if(updateAreaCfg!=null&&updateAreaCfg.size()>0){ this.updateIpBatch(updateAreaCfg); diff --git a/src/main/java/com/nis/web/service/configuration/NumCfgService.java b/src/main/java/com/nis/web/service/configuration/NumCfgService.java index 53b66a6b1..454c22e3e 100644 --- a/src/main/java/com/nis/web/service/configuration/NumCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/NumCfgService.java @@ -35,7 +35,7 @@ public class NumCfgService extends CrudService { @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public int addNumCfg(NumBoundaryCfg cfg,List areaIpCfgs){ if(areaIpCfgs!=null&&areaIpCfgs.size()>0){ - this.saveIpBatch(areaIpCfgs); +// this.saveIpBatch(areaIpCfgs); } return numCfgDao.insert(cfg); } @@ -52,7 +52,7 @@ public class NumCfgService extends CrudService { @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public int updateNumCfg(NumBoundaryCfg cfg,List addAreaCfg,List updateAreaCfg,List deleteAreaCfgs){ if(addAreaCfg!=null&&addAreaCfg.size()>0){ - this.saveIpBatch(addAreaCfg); +// this.saveIpBatch(addAreaCfg); } if(updateAreaCfg!=null&&updateAreaCfg.size()>0){ this.updateIpBatch(updateAreaCfg); diff --git a/src/main/java/com/nis/web/service/configuration/StringCfgService.java b/src/main/java/com/nis/web/service/configuration/StringCfgService.java index 01643a4aa..bfc40c84f 100644 --- a/src/main/java/com/nis/web/service/configuration/StringCfgService.java +++ b/src/main/java/com/nis/web/service/configuration/StringCfgService.java @@ -52,7 +52,7 @@ public class StringCfgService extends CrudService { @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public int addStringCfg(BaseStringCfg baseStringCfg,List areaIpCfgs){ if(areaIpCfgs!=null&&areaIpCfgs.size()>0){ - this.saveIpBatch(areaIpCfgs); +// this.saveIpBatch(areaIpCfgs); } //调用服务接口获取compileId Integer compileId = 0; @@ -88,7 +88,7 @@ public class StringCfgService extends CrudService { @Transactional(readOnly=false,rollbackFor=RuntimeException.class) public int updateStringCfg(BaseStringCfg baseStringCfg,List addAreaCfg,List updateAreaCfg,List deleteAreaCfgs){ if(addAreaCfg!=null&&addAreaCfg.size()>0){ - this.saveIpBatch(addAreaCfg); +// this.saveIpBatch(addAreaCfg); } if(updateAreaCfg!=null&&updateAreaCfg.size()>0){ this.updateIpBatch(updateAreaCfg); diff --git a/src/main/webapp/WEB-INF/tags/sys/delRow.tag b/src/main/webapp/WEB-INF/tags/sys/delRow.tag index a95cbe1ff..545824f2f 100644 --- a/src/main/webapp/WEB-INF/tags/sys/delRow.tag +++ b/src/main/webapp/WEB-INF/tags/sys/delRow.tag @@ -120,15 +120,23 @@ var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox"); function doAll(checkboxes,url){ // var url = $(this).attr('data-url'); var str=""; + var compileIdStr=""; var ids=""; + var compileIds=""; checkboxes.each(function(){ if(true == $(this).is(':checked')){ str+=$(this).attr("id")+","; + if($(this).attr("compileId")){ + compileIdStr +=$(this).attr("compileId")+","; + } } }); if(str.substr(str.length-1)== ','){ ids = str.substr(0,str.length-1); } + if(compileIdStr.substr(str.length-1)== ','){ + compileIds = compileIdStr.substr(0,compileIdStr.length-1); + } if(ids == ""){ //top.$.jBox.tip("不能选择公共模型("+nodes[i].name+")请重新选择。"); top.$.jBox.tip("", ""); @@ -138,9 +146,9 @@ var checkboxes=$("#${id} ${value} tbody tr td input.i-checks:checkbox"); if(v=="ok"){ if(url.indexOf("?")>0){ - window.location = url+"&ids="+ids; + window.location = url+"&ids="+ids+"&compileIds"+compileIds; }else{ - window.location = url+"?ids="+ids; + window.location = url+"?ids="+ids+"&compileIds"+compileIds; } //$("#searchForm").submit(); diff --git a/src/main/webapp/WEB-INF/views/cfg/iplist/form.jsp b/src/main/webapp/WEB-INF/views/cfg/iplist/form.jsp new file mode 100644 index 000000000..d4c945d7a --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/iplist/form.jsp @@ -0,0 +1,119 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + +
+

+ +

+
+
+
+
+
+ + + +
+
+
+ +
+
+ + + + + + + + + + + +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+ + + +
+
+
+
+
+ + <%@include file="/WEB-INF/include/form/ipInfo.jsp" %> + <%@include file="/WEB-INF/include/form/areaInfo.jsp" %> + <%@include file="/WEB-INF/include/form/basicInfo.jsp" %> +
+
+
+
+
+
+ + +
+
+
+
+
+
+ + +
+
+
+
+
+ + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/iplist/list.jsp b/src/main/webapp/WEB-INF/views/cfg/iplist/list.jsp new file mode 100644 index 000000000..a43410b83 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/cfg/iplist/list.jsp @@ -0,0 +1,322 @@ +<%@ page contentType="text/html;charset=UTF-8"%> +<%@ include file="/WEB-INF/include/taglib.jsp"%> + + +<spring:message code="${cfgName}"></spring:message> + + + + +
+ +

+ + +

+ +
+
+
+
+
+ + + + + + + + +
+
+ + + + + + + +
+
+ +
+
+ + + + + + + + + +
+ + + +
+
+
+ + + +
+
+ + + + + +
+ + +
+
+ + href="javascript:;"> + + +
+
+ + + +
+
+
+
+ + +
+
+ +
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+
+
+ + " onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:true});"/> + +
+
+
+
+ +
+
+
+ + + + + + <%-- --%> + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> + + + + + + + <%-- --%> + + + + + + + + + + + + + + + <%-- --%> + + + + + + + + + + + +
ip
${status.index+1 }${cfg.cfgDesc } + ${ipType.itemValue} + ${cfg.srcIpAddress }${cfg.srcPort }${cfg.destIpAddress }${cfg.destPort } + + + + + + + + + + + + + + ${cfg.requestName } + + + + ${fl.itemValue}, + + + + + + + ${xz.itemValue}, + + + + + + ${lable.itemValue}, + + + ${cfg.areaEffectiveIds } + + + + + + + + + + + ${cfg.creatorName }${cfg.editorName }${cfg.auditorName }
+
${page}
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp index fe09030f3..0ac60ddfd 100644 --- a/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp +++ b/src/main/webapp/WEB-INF/views/cfg/whitelist/ipForm.jsp @@ -185,7 +185,7 @@ $(function(){
- +