IP类配置提交

This commit is contained in:
wangxin
2018-02-25 18:43:20 +08:00
parent 1c93923000
commit 6647314e2b
16 changed files with 1411 additions and 107 deletions

View File

@@ -15,6 +15,7 @@ import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import com.nis.domain.configuration.BaseCfg;
import com.nis.util.DateUtils;
import com.nis.util.JsonMapper;
import com.nis.web.service.ArchiveServcie;
@@ -31,6 +32,7 @@ import com.nis.web.service.configuration.FtpCfgService;
import com.nis.web.service.configuration.IpCfgService;
import com.nis.web.service.configuration.MailCfgService;
import com.nis.web.service.configuration.MediaCfgService;
import com.nis.web.service.configuration.RequestInfoService;
import com.nis.web.service.configuration.ServiceDictInfoService;
import com.nis.web.service.configuration.SslCfgService;
import com.nis.web.service.configuration.SysDictInfoService;
@@ -105,6 +107,9 @@ public class BaseController {
@Autowired
protected ServiceConfigInfoService serviceConfigInfoService;
@Autowired
protected RequestInfoService requestInfoService;
/**
* 管理基础路径
*/
@@ -205,8 +210,4 @@ public class BaseController {
}
});
}
}

View File

@@ -1,5 +1,8 @@
package com.nis.web.controller.configuration;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -8,11 +11,14 @@ 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.RequestMethod;
import com.nis.domain.Page;
import com.nis.domain.ServiceConfigInfo;
import com.nis.domain.configuration.BaseCfg;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.domain.configuration.RequestInfo;
import com.nis.domain.configuration.ServiceDictInfo;
import com.nis.util.Constants;
import com.nis.web.controller.BaseController;
/**
@@ -23,11 +29,9 @@ import com.nis.web.controller.BaseController;
@Controller
@RequestMapping("${adminPath}/cfg/ip")
public class IpCfgController extends BaseController{
// @Autowired
// protected IpCfgService ipCfgService;
@RequestMapping(value = {"ipWhiteList"})
public String ipWhiteList() {
public String ipWhiteList(Model model,BaseIpCfg baseIpCfg,HttpServletRequest request,HttpServletResponse response) {
return "/cfg/ipWhiteList";
}
@@ -37,34 +41,52 @@ public class IpCfgController extends BaseController{
return "/cfg/ipWhiteForm";
}
@RequestMapping(value = {"ipBlockList"})
public String ipBlockList(Model model,BaseIpCfg baseIpCfg,HttpServletRequest request,HttpServletResponse response) {
if(baseIpCfg!=null){
Integer serviceId=baseIpCfg.getServiceId();
logger.info("sercice id is "+serviceId);
@RequestMapping(value = {"ipCfgList"})
public String ipCfgList(Model model,Integer pageNo,Integer pageSize,String cfgName,@ModelAttribute("ipCfg")BaseIpCfg ipCfg,HttpServletRequest request,HttpServletResponse response) {
if(ipCfg!=null){
Integer serviceId=ipCfg.getServiceId();
logger.info("servcice id is "+serviceId);
if(serviceId!=null){
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
if(serviceConfigInfo!=null){
String tableName=serviceConfigInfo.getTableName();
if(!StringUtils.isBlank(tableName)){
logger.info("table name is "+tableName);
baseIpCfg.setTableName(tableName);
Page<BaseIpCfg> page = ipCfgService.findPage(new Page<BaseIpCfg>(request, response, 1), baseIpCfg);
ipCfg.setTableName(tableName);
Page<BaseIpCfg> searchPage=new Page<BaseIpCfg>(request, response, 1);
if(pageNo!=null) searchPage.setPageNo(pageNo);
if(pageSize!=null) searchPage.setPageSize(pageSize);
if(ipCfg.getPage()!=null){
if(!StringUtils.isBlank(ipCfg.getPage().getOrderBy()));
searchPage.setOrderBy(ipCfg.getPage().getOrderBy());
}
Page<BaseIpCfg> page = ipCfgService.findPage(searchPage, ipCfg);
model.addAttribute("page", page);
model.addAttribute("serviceId", serviceId);
model.addAttribute("cfgName", cfgName);
model.addAttribute("action", ipCfg.getAction());
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
model.addAttribute("requestInfos", requestInfos);
List<ServiceDictInfo> fls=serviceDictInfoService.findFlDict();
model.addAttribute("fls", fls);
List<ServiceDictInfo> xzs=serviceDictInfoService.findXzDict();
model.addAttribute("xzs", xzs);
List<ServiceDictInfo> lables=serviceDictInfoService.findLableDict();
model.addAttribute("lables", lables);
}
}else{
logger.error("未获取到正确的serviceId");
}
}
}
return "/cfg/ipBlockList";
return "/cfg/ipCfgList";
}
@RequestMapping(value = {"ipBlockForm"})
public String ipBlockForm(Integer serviceId,Model model,HttpServletRequest request,HttpServletResponse response) {
@RequestMapping(value = {"ipCfgForm"})
public String ipCfgForm(int action,String cfgName,Integer serviceId,Model model,HttpServletRequest request,HttpServletResponse response) {
logger.info("sercice id is "+serviceId);
System.out.println("ipBlockForm loaded");
if(serviceId!=null){
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
if(serviceConfigInfo!=null){
@@ -80,7 +102,18 @@ public class IpCfgController extends BaseController{
BaseIpCfg ipcfg=(BaseIpCfg)clazz.newInstance();
ipcfg.setTableName(tableName);
ipcfg.initDefaultValue();
ipcfg.setAction(action);
ipcfg.setServiceId(serviceId);
model.addAttribute("_ipCfg", ipcfg);
model.addAttribute("cfgName", cfgName);
List<RequestInfo> requestInfos=requestInfoService.getValidRequestInfo();
model.addAttribute("requestInfos", requestInfos);
List<ServiceDictInfo> fls=serviceDictInfoService.findFlDict();
model.addAttribute("fls", fls);
List<ServiceDictInfo> xzs=serviceDictInfoService.findXzDict();
model.addAttribute("xzs", xzs);
List<ServiceDictInfo> lables=serviceDictInfoService.findLableDict();
model.addAttribute("lables", lables);
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
// TODO Auto-generated catch block
logger.error("打开新增IP窗口失败",e);
@@ -88,25 +121,293 @@ public class IpCfgController extends BaseController{
}
}
}
}else{
logger.error("未获取到正确的serviceId");
}
return "/cfg/ipBlockForm";
return "/cfg/ipCfgForm";
}
@RequestMapping(value = {"updateIpCfgForm"})
public String updateIpCfgForm(String tableName,int action,long cfgId,String cfgName,Integer serviceId,Model model,HttpServletRequest request,HttpServletResponse response) {
if(!StringUtils.isBlank(tableName)){
logger.info("table name is "+tableName);
BaseIpCfg searchBean=new BaseIpCfg();
searchBean.setCfgId(cfgId);
searchBean.setTableName(tableName);
BaseIpCfg ipCfg=ipCfgService.getIpCfgById(searchBean);
model.addAttribute("_ipCfg", ipCfg);
model.addAttribute("cfgName", cfgName);
List<RequestInfo> requestInfos=requestInfoService.getAllRequestInfo();
model.addAttribute("requestInfos", requestInfos);
List<ServiceDictInfo> fls=serviceDictInfoService.findAllFlDict();
model.addAttribute("fls", fls);
List<ServiceDictInfo> xzs=serviceDictInfoService.findAllXzDict();
model.addAttribute("xzs", xzs);
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
model.addAttribute("lables", lables);
}else if(serviceId!=null){
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
if(serviceConfigInfo!=null){
tableName=serviceConfigInfo.getTableName();
if(!StringUtils.isBlank(tableName)){
logger.info("table name is "+tableName);
BaseIpCfg searchBean=new BaseIpCfg();
searchBean.setCfgId(cfgId);
searchBean.setTableName(tableName);
BaseIpCfg ipCfg=ipCfgService.getIpCfgById(searchBean);
model.addAttribute("_ipCfg", ipCfg);
model.addAttribute("cfgName", cfgName);
List<RequestInfo> requestInfos=requestInfoService.getAllRequestInfo();
model.addAttribute("requestInfos", requestInfos);
List<ServiceDictInfo> fls=serviceDictInfoService.findAllFlDict();
model.addAttribute("fls", fls);
List<ServiceDictInfo> xzs=serviceDictInfoService.findAllXzDict();
model.addAttribute("xzs", xzs);
List<ServiceDictInfo> lables=serviceDictInfoService.findAllLableDict();
model.addAttribute("lables", lables);
}
}
}else{
logger.error("未获取到正确的表名");
}
return "/cfg/ipCfgForm";
}
/**
*
* addIpPortCfg(新增IP配置)
* addIpCfg(新增IP配置)
* (这里描述这个方法适用条件 可选)
* @return
*String
* @exception
* @since 1.0.0
*/
@RequestMapping(method=RequestMethod.POST,value = {"addIpCfg"})
public String addIpCfg(@ModelAttribute("ipCfg") BaseIpCfg ipCfg) {
if(ipCfg!=null&&!StringUtils.isBlank(ipCfg.getTableName())){
int result=ipCfgService.addIpCfg(ipCfg);
@RequestMapping(value = {"saveOrUpdateIpCfg"})
public String saveOrUpdateIpCfg(String cfgName,Model model, BaseIpCfg ipCfg) {
logger.info("saveOrUpdateIpCfg loaded");
if(ipCfg==null){
logger.error("无法保存空的配置!");
addMessage(model,"保存失败!");
}else if(!StringUtils.isBlank(ipCfg.getTableName())){
int serviceId=ipCfg.getServiceId();
long compileId=getCompileId(ipCfg);
ipCfg.setCreatorId(ipCfg.getCurrentUser().getId());
ipCfg.setCreateTime(new Date());
ipCfg.setIsValid(Constants.VALID_NO);
ipCfg.setIsAudit(Constants.AUDIT_NOT_YET);
ipCfg.setCompileId(compileId);
if(ipCfg.getCfgId()==null)
ipCfgService.addIpCfg(ipCfg);
else
ipCfgService.updateIpCfg(ipCfg);
model.addAttribute("serviceId",serviceId);
model.addAttribute("action",ipCfg.getAction());
model.addAttribute("cfgName",cfgName);
addMessage(model,"保存成功,正在为您跳转页面...");
}else if(ipCfg.getServiceId()!=null){
int serviceId=ipCfg.getServiceId();
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
if(serviceConfigInfo!=null){
String tableName=serviceConfigInfo.getTableName();
if(!StringUtils.isBlank(tableName)){
long compileId=getCompileId(ipCfg);
ipCfg.setTableName(tableName);
ipCfg.setCreatorId(ipCfg.getCurrentUser().getId());
ipCfg.setCreateTime(new Date());
ipCfg.setIsValid(Constants.VALID_NO);
ipCfg.setIsAudit(Constants.AUDIT_NOT_YET);
ipCfg.setCompileId(compileId);
if(ipCfg.getCfgId()==null)
ipCfgService.addIpCfg(ipCfg);
else
ipCfgService.updateIpCfg(ipCfg);
model.addAttribute("serviceId",serviceId);
model.addAttribute("action",ipCfg.getAction());
model.addAttribute("cfgName",cfgName);
addMessage(model,"保存成功,正在为您跳转页面...");
}
}
}else{
addMessage(model,"保存失败!");
logger.error("无法确定IP配置的表名");
}
return "/cfg/ipBlockForm";
return "/cfg/resultPage";//StringEscapeUtils.escapeHtml4("?serviceId="+ipCfg.getServiceId()+"&action="+ipCfg.getAction()+"&cfgName="+cfgName);
}
/**
*
* updateIpCfg(更新IP配置)
* (这里描述这个方法适用条件 可选)
* @return
*String
* @exception
* @since 1.0.0
*/
// @RequestMapping(value = {"updateIpCfg"})
// public String updateIpCfg(@ModelAttribute("ipCfg") BaseIpCfg ipCfg) {
// if(ipCfg==null){
// logger.error("无法修改空的配置!");
// }else if(!StringUtils.isBlank(ipCfg.getTableName())){
// int audit=ipCfgService.getIsAudit(ipCfg);
// //审核未通过方可修改
// if(audit==Constants.AUDIT_NO){
// ipCfg.setEditorId(ipCfg.getCurrentUser().getId());
// ipCfg.setEditTime(new Date());
// int result=ipCfgService.updateIpCfg(ipCfg);
// }else{
// logger.warn("审核未通过配置方可修改!");
// }
// }else if(ipCfg.getServiceId()!=null){
// int serviceId=ipCfg.getServiceId();
// ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
// if(serviceConfigInfo!=null){
// String tableName=serviceConfigInfo.getTableName();
// if(!StringUtils.isBlank(tableName)){
// ipCfg.setTableName(tableName);
// int audit=ipCfgService.getIsAudit(ipCfg);
// //审核未通过方可修改
// if(audit==Constants.AUDIT_NO){
// ipCfg.setEditorId(ipCfg.getCurrentUser().getId());
// ipCfg.setEditTime(new Date());
// int result=ipCfgService.updateIpCfg(ipCfg);
// }else{
// logger.warn("审核未通过配置方可修改!");
// }
// }
// }
// }else{
// logger.error("无法确定IP配置的表名");
// }
// return "/cfg/resultPage";
// }
/**
*
* auditIpCfg(审核IP配置)
* (这里描述这个方法适用条件 可选)
* @return
*String
* @exception
* @since 1.0.0
*/
@RequestMapping(value = {"auditIpCfg"})
public String auditIpCfg(String cfgName,BaseIpCfg ipCfg,Model model) {
if(ipCfg==null){
logger.error("无法审核空的配置!");
}else if(!StringUtils.isBlank(ipCfg.getTableName())){
int audit=ipCfgService.getIsAudit(ipCfg);
if(audit==Constants.AUDIT_YES&&ipCfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
logger.error("审核通过的配置只能取消审核通过!");
}else{
ipCfg.setAuditorId(ipCfg.getCurrentUser().getId());
ipCfg.setAuditTime(new Date());
if(ipCfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过设置有效标志为0
ipCfg.setIsValid(Constants.VALID_NO);
}else if(ipCfg.getIsAudit()==Constants.AUDIT_YES){//审核通过设置有效标志为1
ipCfg.setIsValid(Constants.VALID_YES);
}
int result=ipCfgService.auditIpCfg(ipCfg);
}
}else if(ipCfg.getServiceId()!=null){
int serviceId=ipCfg.getServiceId();
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
if(serviceConfigInfo!=null){
String tableName=serviceConfigInfo.getTableName();
if(!StringUtils.isBlank(tableName)){
ipCfg.setTableName(tableName);
int audit=ipCfgService.getIsAudit(ipCfg);
if(audit==Constants.AUDIT_YES&&ipCfg.getIsAudit()!=Constants.AUDIT_NOT_YES){
logger.error("审核通过的配置只能取消审核通过!");
}else{
ipCfg.setAuditorId(ipCfg.getCurrentUser().getId());
ipCfg.setAuditTime(new Date());
if(ipCfg.getIsAudit()==Constants.AUDIT_NOT_YES){//取消审核通过设置有效标志为0
ipCfg.setIsValid(Constants.VALID_NO);
}else if(ipCfg.getIsAudit()==Constants.AUDIT_YES){//审核通过设置有效标志为1
ipCfg.setIsValid(Constants.VALID_YES);
}
int result=ipCfgService.auditIpCfg(ipCfg);
}
}
}
}else{
logger.error("无法确定IP配置的表名");
}
return "redirect:" + adminPath + "/cfg/ip/ipCfgList?serviceId="+ipCfg.getServiceId()+"&action="+ipCfg.getAction()+"&cfgName"+cfgName;
}
/**
*
* auditIpCfg(删除IP配置逻辑删除)
* (这里描述这个方法适用条件 可选)
* @return
*String
* @exception
* @since 1.0.0
*/
@RequestMapping(value = {"deleteIpCfg"})
public String deleteIpCfg(String tableName,int action,long cfgId,String cfgName,Integer serviceId,Model model) {
if(!StringUtils.isBlank(tableName)){
int audit=ipCfgService.getIsAudit(tableName,cfgId);
//未审核时可删除
if(audit!=Constants.AUDIT_YES){
BaseIpCfg ipCfg=new BaseIpCfg();
ipCfg.setCfgId(cfgId);
ipCfg.setTableName(tableName);
ipCfg.setEditorId(ipCfg.getCurrentUser().getId());
ipCfg.setEditTime(new Date());
ipCfg.setIsValid(Constants.VALID_DEL);
int result=ipCfgService.deleteIpCfg(ipCfg);
model.addAttribute("serviceId", serviceId);
model.addAttribute("cfgName", cfgName);
model.addAttribute("action", action);
addMessage(model,"删除成功,正在为您跳转页面...");
}else{
logger.error("通过审核的配置不能删除!");
}
}else if(serviceId!=null){
ServiceConfigInfo serviceConfigInfo=serviceConfigInfoService.findSysServiceConfigInfo(serviceId);
if(serviceConfigInfo!=null){
tableName=serviceConfigInfo.getTableName();
if(!StringUtils.isBlank(tableName)){
BaseIpCfg ipCfg=new BaseIpCfg();
ipCfg.setCfgId(cfgId);
ipCfg.setTableName(tableName);
int audit=ipCfgService.getIsAudit(ipCfg);
//未审核时可删除
if(audit!=Constants.AUDIT_YES){
ipCfg.setEditorId(ipCfg.getCurrentUser().getId());
ipCfg.setEditTime(new Date());
ipCfg.setIsValid(Constants.VALID_DEL);
int result=ipCfgService.deleteIpCfg(ipCfg);
model.addAttribute("serviceId", serviceId);
model.addAttribute("cfgName", cfgName);
model.addAttribute("action", action);
addMessage(model,"删除成功,正在为您跳转页面...");
}else{
logger.error("通过审核的配置不能删除!");
}
}
}
}else{
logger.error("无法确定IP配置的表名");
}
return "/cfg/resultPage";
}
/**
*
* getCompileId(获取编译ID)
* (这里描述这个方法适用条件 可选)
* @return
*long
* @exception
* @since 1.0.0
*/
protected long getCompileId(BaseCfg cfg){
return 0;
}
}

View File

@@ -18,9 +18,12 @@ public interface IpCfgDao extends CrudDao<BaseIpCfg>{
public BaseIpCfg getById(@Param("tableName")String tableName,@Param("cfgId")Long id) ;
public BaseIpCfg get(BaseIpCfg entity) ;
public List<BaseIpCfg> findList(BaseIpCfg entity) ;
public List<BaseIpCfg> findAllList(BaseIpCfg entity) ;
public int insert(BaseIpCfg entity) ;
public int updateByPrimaryKeySelective(BaseIpCfg entity) ;
public int updateValid(BaseIpCfg entity) ;
public int delete(BaseIpCfg entity) ;
public int audit(BaseIpCfg entity) ;
public int getIsValid(@Param("tableName")String tableName,@Param("cfgId")Long id);
public int getIsValid(BaseIpCfg entity);
public int getIsAudit(@Param("tableName")String tableName,@Param("cfgId")Long id);
public int getIsAudit(BaseIpCfg entity);
}

View File

@@ -12,7 +12,7 @@
<result column="dst_ip" property="dstIp" jdbcType="VARCHAR" />
<result column="dst_ip_mask" property="dstIpMask" jdbcType="VARCHAR" />
<result column="dst_port" property="dstPort" jdbcType="VARCHAR" />
<result column="dst_port_mask" property="srcPortMask" jdbcType="VARCHAR" />
<result column="dst_port_mask" property="dstPortMask" jdbcType="VARCHAR" />
<result column="direction" property="direction" jdbcType="INTEGER" />
<result column="protocol" property="protocol" jdbcType="INTEGER" />
<result column="protocol_id" property="protocolId" jdbcType="INTEGER" />
@@ -34,6 +34,42 @@
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="BaseIpMapWithUser" type="com.nis.domain.configuration.BaseIpCfg" >
<id column="cfg_id" property="cfgId" jdbcType="BIGINT" />
<result column="cfg_desc" property="cfgDesc" jdbcType="VARCHAR" />
<result column="ip_type" property="ipType" jdbcType="INTEGER" />
<result column="src_ip" property="srcIp" jdbcType="VARCHAR" />
<result column="src_ip_mask" property="srcIpMask" jdbcType="VARCHAR" />
<result column="src_port" property="srcPort" jdbcType="VARCHAR" />
<result column="src_port_mask" property="srcPortMask" jdbcType="VARCHAR" />
<result column="dst_ip" property="dstIp" jdbcType="VARCHAR" />
<result column="dst_ip_mask" property="dstIpMask" jdbcType="VARCHAR" />
<result column="dst_port" property="dstPort" jdbcType="VARCHAR" />
<result column="dst_port_mask" property="dstPortMask" jdbcType="VARCHAR" />
<result column="direction" property="direction" jdbcType="INTEGER" />
<result column="protocol" property="protocol" jdbcType="INTEGER" />
<result column="protocol_id" property="protocolId" jdbcType="INTEGER" />
<result column="action" property="action" jdbcType="INTEGER" />
<result column="is_valid" property="isValid" jdbcType="INTEGER" />
<result column="is_audit" property="isAudit" jdbcType="INTEGER" />
<result column="creator_id" property="creatorId" jdbcType="INTEGER" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="editor_id" property="editorId" jdbcType="INTEGER" />
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP" />
<result column="auditor_id" property="auditorId" jdbcType="INTEGER" />
<result column="audit_time" property="auditTime" jdbcType="TIMESTAMP" />
<result column="service_id" property="serviceId" jdbcType="INTEGER" />
<result column="request_id" property="requestId" jdbcType="INTEGER" />
<result column="compile_id" property="compileId" jdbcType="INTEGER" />
<result column="is_area_effective" property="isAreaEffective" jdbcType="INTEGER" />
<result column="classify" property="classify" jdbcType="VARCHAR" />
<result column="attribute" property="attribute" jdbcType="VARCHAR" />
<result column="lable" property="lable" jdbcType="VARCHAR" />
<result column="area_effective_ids" property="areaEffectiveIds" jdbcType="VARCHAR" />
<result column="creator_name" property="creatorName" jdbcType="VARCHAR" />
<result column="auditor_name" property="auditorName" jdbcType="VARCHAR" />
<result column="editor_name" property="editorName" jdbcType="VARCHAR" />
</resultMap>
<resultMap id="FtpIpMap" type="com.nis.domain.configuration.FtpIpCfg" extends="BaseIpMap" />
<resultMap id="HttpIpMap" type="com.nis.domain.configuration.HttpIpCfg" extends="BaseIpMap" />
<resultMap id="L2tpIpMap" type="com.nis.domain.configuration.L2tpIpCfg" extends="BaseIpMap" />
@@ -56,6 +92,14 @@
SERVICE_ID,REQUEST_ID,COMPILE_ID,IS_AREA_EFFECTIVE,CLASSIFY,
ATTRIBUTE,LABLE,AREA_EFFECTIVE_IDS
</sql>
<sql id="BaseIpCfg_Column_List_with_id_alias" >
r.CFG_ID as cfgId, r.CFG_DESC as cfgDesc, r.IP_TYPE as ipType, r.SRC_IP as scrIp, r.SRC_IP_MASK as srcIpMask, r.SRC_PORT as srcPort,
r.SRC_PORT_MASK as srcPortMask ,r.DST_IP as dstIp,r.DST_IP_MASK as dstIpMask, r.DST_PORT as dstPort, r.DST_PORT_MASK as dstPortMask,
r.DIRECTION as direction,r.PROTOCOL as protocol,r.PROTOCOL_ID as protocolId,r.ACTION as action,r.IS_VALID as isValid,r.IS_AUDIT as isAudit,
r.CREATOR_ID as creatorId,r.CREATE_TIME AS createTime,r.EDITOR_ID as editorId,r.EDIT_TIME AS editTime,r.AUDITOR_ID as auditorId,r.AUDIT_TIME AS auditTime,
r.SERVICE_ID as serviceId,r.REQUEST_ID AS requestId,r.COMPILE_ID AS compileId,r.IS_AREA_EFFECTIVE as isAreaEffective,r.classify,
r.ATTRIBUTE AS attribute,r.LABLE AS lable,r.AREA_EFFECTIVE_IDS AS areaEffectiveIds
</sql>
<sql id="BaseIpCfg_Column_List" >
CFG_DESC, IP_TYPE, SRC_IP, SRC_IP_MASK, SRC_PORT,
SRC_PORT_MASK ,DST_IP ,DST_IP_MASK, DST_PORT, DST_PORT_MASK,
@@ -89,101 +133,235 @@
FROM ${tableName}
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="cfgId != null">
CFG_ID=#{cfgId,jdbcType=BIGINT}
AND CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="cfgDesc != null">
CFG_DESC=#{cfgDesc,jdbcType=VARCHAR}
AND CFG_DESC=#{cfgDesc,jdbcType=VARCHAR}
</if>
<if test="ipType != null">
IP_TYPE=#{ipType,jdbcType=INTEGER}
AND IP_TYPE=#{ipType,jdbcType=INTEGER}
</if>
<if test="srcIp != null">
SRC_IP=#{srcIp,jdbcType=VARCHAR}
AND SRC_IP=#{srcIp,jdbcType=VARCHAR}
</if>
<if test="srcIpMask != null">
SRC_IP_MASK=#{srcIpMask,jdbcType=VARCHAR}
AND SRC_IP_MASK=#{srcIpMask,jdbcType=VARCHAR}
</if>
<if test="srcPort != null">
SRC_PORT=#{srcPort,jdbcType=VARCHAR}
AND SRC_PORT=#{srcPort,jdbcType=VARCHAR}
</if>
<if test="srcPortMask != null">
SRC_PORT_MASK=#{srcPortMask,jdbcType=VARCHAR}
AND SRC_PORT_MASK=#{srcPortMask,jdbcType=VARCHAR}
</if>
<if test="dstIp != null">
DST_IP=#{dstIp,jdbcType=VARCHAR}
AND DST_IP=#{dstIp,jdbcType=VARCHAR}
</if>
<if test="dstIpMask != null">
DST_IP_MASK=#{dstIpMask,jdbcType=VARCHAR}
AND DST_IP_MASK=#{dstIpMask,jdbcType=VARCHAR}
</if>
<if test="dstPort != null">
DST_PORT=#{dstPort,jdbcType=VARCHAR}
AND DST_PORT=#{dstPort,jdbcType=VARCHAR}
</if>
<if test="dstPortMask != null">
DST_PORT_MASK=#{dstPortMask,jdbcType=VARCHAR}
AND DST_PORT_MASK=#{dstPortMask,jdbcType=VARCHAR}
</if>
<if test="direction != null">
DIRECTION=#{direction,jdbcType=INTEGER}
AND DIRECTION=#{direction,jdbcType=INTEGER}
</if>
<if test="protocol != null">
PROTOCOL=#{protocol,jdbcType=INTEGER}
AND PROTOCOL=#{protocol,jdbcType=INTEGER}
</if>
<if test="protocolId != null">
PROTOCOL_ID=#{protocolId,jdbcType=INTEGER}
AND PROTOCOL_ID=#{protocolId,jdbcType=INTEGER}
</if>
<if test="action != null">
ACTION=#{action,jdbcType=INTEGER}
AND ACTION=#{action,jdbcType=INTEGER}
</if>
<if test="isValid != null">
IS_VALID=#{isValid,jdbcType=INTEGER}
AND IS_VALID=#{isValid,jdbcType=INTEGER}
</if>
<if test="isAudit != null">
IS_AUDIT=#{isAudit,jdbcType=INTEGER}
AND IS_AUDIT=#{isAudit,jdbcType=INTEGER}
</if>
<if test="creatorId != null">
CREATOR_ID=#{creatorId,jdbcType=INTEGER}
AND CREATOR_ID=#{creatorId,jdbcType=INTEGER}
</if>
<if test="createTime != null">
CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
AND CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
</if>
<if test="editorId != null">
EDITOR_ID=#{editorId,jdbcType=INTEGER}
AND EDITOR_ID=#{editorId,jdbcType=INTEGER}
</if>
<if test="editTime != null">
EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
AND EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
</if>
<if test="auditorId != null">
AUDITOR_ID=#{auditorId,jdbcType=INTEGER}
AND AUDITOR_ID=#{auditorId,jdbcType=INTEGER}
</if>
<if test="auditTime != null">
AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
AND AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
</if>
<if test="serviceId != null">
SERVICE_ID=#{serviceId,jdbcType=INTEGER}
AND SERVICE_ID=#{serviceId,jdbcType=INTEGER}
</if>
<if test="requestId != null">
REQUEST_ID=#{requestId,jdbcType=INTEGER}
AND REQUEST_ID=#{requestId,jdbcType=INTEGER}
</if>
<if test="compileId != null">
COMPILE_ID=#{compileId,jdbcType=INTEGER}
AND COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
AND IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>
<if test="classify != null">
classify=#{classify,jdbcType=VARCHAR}
AND classify=#{classify,jdbcType=VARCHAR}
</if>
<if test="attribute != null">
attribute=#{attribute,jdbcType=VARCHAR}
AND attribute=#{attribute,jdbcType=VARCHAR}
</if>
<if test="lable != null">
lable=#{lable,jdbcType=VARCHAR}
AND lable=#{lable,jdbcType=VARCHAR}
</if>
<if test="areaEffectiveIds != null">
AREA_EFFECTIVE_IDS=#{areaEffectiveIds,jdbcType=VARCHAR}
AND AREA_EFFECTIVE_IDS=#{areaEffectiveIds,jdbcType=VARCHAR}
</if>
</trim>
</select>
<select id="findList" resultMap="BaseIpMap">
<select id="findList" resultMap="BaseIpMapWithUser">
select
<!--<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
${page.fields}
</when>
<otherwise>-->
<include refid="BaseIpCfg_Column_List_with_id_alias"/>
<!-- </otherwise>
</choose> -->
<trim prefix="," prefixOverrides=",">
, s.name as creator_name,e.name as editor_name,u.name as auditor_name
,ri.request_title as requestName,sdic.item_value as classifyName,sdia.item_value as attributeName
,sdil.item_value as lableName
</trim>
from ${tableName} 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
left join request_info ri on r.request_id=ri.id
left join service_dict_info sdic on r.classify=sdic.item_code and sdic.item_type=1 and sdic.is_valid=1 and sdic.is_leaf=0
left join service_dict_info sdia on r.attribute=sdia.item_code and sdia.item_type=1 and sdia.is_valid=1 and sdia.is_leaf=0
left join service_dict_info sdil on r.lable=sdil.item_code and sdil.item_type=1 and sdil.is_valid=1 and sdil.is_leaf=0
<trim prefix="WHERE" prefixOverrides="AND |OR ">
<if test="page !=null and page.where != null and page.where != ''">
AND ${page.where}
</if>
<if test="cfgId != null">
AND r.CFG_ID=#{cfgId,jdbcType=BIGINT}
</if>
<if test="cfgDesc != null">
AND r.CFG_DESC like concat(concat('%',#{cfgDesc,jdbcType=VARCHAR}),'%')
</if>
<if test="ipType != null">
AND r.IP_TYPE=#{ipType,jdbcType=INTEGER}
</if>
<if test="srcIp != null">
AND r.SRC_IP=#{srcIp,jdbcType=VARCHAR}
</if>
<if test="srcIpMask != null">
AND r.SRC_IP_MASK=#{srcIpMask,jdbcType=VARCHAR}
</if>
<if test="srcPort != null">
AND r.SRC_PORT=#{srcPort,jdbcType=VARCHAR}
</if>
<if test="srcPortMask != null">
AND r.SRC_PORT_MASK=#{srcPortMask,jdbcType=VARCHAR}
</if>
<if test="dstIp != null">
AND r.DST_IP=#{dstIp,jdbcType=VARCHAR}
</if>
<if test="dstIpMask != null">
AND r.DST_IP_MASK=#{dstIpMask,jdbcType=VARCHAR}
</if>
<if test="dstPort != null">
AND r.DST_PORT=#{dstPort,jdbcType=VARCHAR}
</if>
<if test="dstPortMask != null">
AND r.DST_PORT_MASK=#{dstPortMask,jdbcType=VARCHAR}
</if>
<if test="direction != null">
AND r.DIRECTION=#{direction,jdbcType=INTEGER}
</if>
<if test="protocol != null">
AND r.PROTOCOL=#{protocol,jdbcType=INTEGER}
</if>
<if test="protocolId != null">
AND r.PROTOCOL_ID=#{protocolId,jdbcType=INTEGER}
</if>
<if test="action != null">
AND r.ACTION=#{action,jdbcType=INTEGER}
</if>
<if test="isValid != null">
AND r.IS_VALID=#{isValid,jdbcType=INTEGER}
</if>
<if test="isValid == null">
AND r.IS_VALID != -1
</if>
<if test="isAudit != null">
AND r.IS_AUDIT=#{isAudit,jdbcType=INTEGER}
</if>
<if test="creatorName != null">
AND CREATOR_NAME like concat(concat('%',#{creatorName,jdbcType=VARCHAR}),'%')
</if>
<if test="createTime != null">
AND r.CREATE_TIME=#{createTime,jdbcType=TIMESTAMP}
</if>
<if test="editorName != null">
AND EDITOR_NAME like concat(concat('%',#{editorName,jdbcType=VARCHAR}),'%')
</if>
<if test="editTime != null">
AND r.EDIT_TIME=#{editTime,jdbcType=TIMESTAMP}
</if>
<if test="auditorName != null">
AND AUDITOR_NAME like concat(concat('%',#{auditorName,jdbcType=VARCHAR}),'%')
</if>
<if test="auditTime != null">
AND r.AUDIT_TIME=#{auditTime,jdbcType=TIMESTAMP}
</if>
<if test="serviceId != null">
AND r.SERVICE_ID=#{serviceId,jdbcType=INTEGER}
</if>
<if test="requestId != null">
AND r.REQUEST_ID=#{requestId,jdbcType=INTEGER}
</if>
<if test="compileId != null">
AND r.COMPILE_ID=#{compileId,jdbcType=INTEGER}
</if>
<if test="isAreaEffective != null">
AND r.IS_AREA_EFFECTIVE=#{isAreaEffective,jdbcType=INTEGER}
</if>
<if test="classify != null">
AND r.classify like concat(concat('%',#{classify,jdbcType=VARCHAR}),'%')
</if>
<if test="attribute != null">
AND r.attribute like concat(concat('%',#{attribute,jdbcType=VARCHAR}),'%')
</if>
<if test="lable != null">
AND r.lable like concat(concat('%',#{lable,jdbcType=VARCHAR}),'%')
</if>
<if test="areaEffectiveIds != null">
AND r.AREA_EFFECTIVE_IDS like concat(concat('%',#{areaEffectiveIds,jdbcType=VARCHAR}),'%')
</if>
</trim>
<choose>
<when test="page !=null and page.orderBy != null and page.orderBy != ''">
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY CFG_ID desc
</otherwise>
</choose>
</select>
<select id="findAllList" resultMap="BaseIpMap">
select
<choose>
<when test="page !=null and page.fields != null and page.fields != ''">
@@ -314,4 +492,23 @@
</set>
where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
<update id="updateValid" parameterType="com.nis.domain.configuration.BaseIpCfg" >
update ${tableName} set is_valid = #{isValid,jdbcType=INTEGER}, editor_id = #{editorId,jdbcType=INTEGER} , edit_time = #{editTime,jdbcType=TIMESTAMP} where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
<update id="audit" parameterType="com.nis.domain.configuration.BaseIpCfg" >
update ${tableName} set is_audit = #{isAudit,jdbcType=INTEGER}, auditor_id = #{auditorId,jdbcType=INTEGER}, audit_time = #{auditTime,jdbcType=TIMESTAMP}
<if test="isValid != null" >
,is_valid = #{isValid,jdbcType=INTEGER}
</if>
where cfg_id = #{cfgId,jdbcType=BIGINT}
</update>
<select id="getIsValid" resultType="java.lang.Integer" parameterType="java.lang.Long" >
SELECT IS_VALID FROM ${tableName}
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
<select id="getIsAudit" resultType="java.lang.Integer" parameterType="java.lang.Long" >
SELECT IS_AUDIT FROM ${tableName}
WHERE CFG_ID = #{cfgId,jdbcType=BIGINT}
</select>
</mapper>

View File

@@ -1,6 +1,7 @@
package com.nis.web.dao.configuration;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
@@ -29,6 +30,4 @@ public interface RequestInfoDao extends CrudDao {
int updateByPrimaryKey(RequestInfo requestInfo);
}

View File

@@ -270,4 +270,48 @@
audit_time = #{auditTime,jdbcType=DATE}
where id = #{id,jdbcType=BIGINT}
</update>
<select id="findAllList" resultMap="BaseResultMap">
select
r.id AS id,
r.request_number AS requestNumber,
r.request_org AS requestOrg,
r.request_time AS requestTime,
r.request_title AS requestTitle,
r.request_content AS requestContent,
r.is_valid AS isValid,
r.is_audit AS isAudit,
s.name AS creatorName,
r.create_time AS createTime,
u.name AS editorName,
r.edit_time AS editTime,
e.name AS currentName,
r.audit_time AS auditTime
from request_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
<trim prefix="where" prefixOverrides="AND|OR">
<if test="requestTitle != null and requestTitle != ''">
AND r.request_title like
<if test="dbName == 'mysql'">CONCAT('%',#{requestTitle}, '%')</if>
</if>
<if test="requestContent != null and requestContent != ''">
AND r.request_content like
<if test="dbName == 'mysql'">CONCAT('%',#{requestContent},'%')</if>
</if>
<if test="requestNumber != null and requestNumber != ''">
AND r.request_number=#{requestNumber}
</if>
<if test="isAudit != null">
AND r.is_audit=${isAudit}
</if>
<if test=" timeType = 'requestTime' and beginDate!=null and beginDate!='' and endDate!=null and endDate!=''">
AND r.request_time between #{beginDate} and #{endDate}
</if>
<if test="timeType = 'createTime' and beginDate!=null and beginDate!='' and endDate!=null and endDate!=''">
AND (r.create_time between #{beginDate} and #{endDate}) or (r.audit_time between #{beginDate} and #{endDate})
</if>
</trim>
order by r.request_time desc
</select>
</mapper>

View File

@@ -44,6 +44,9 @@ public interface ServiceDictInfoDao extends CrudDao<ServiceDictInfo> {
* @return
*/
List<ServiceDictInfo> findAllDict();
List<ServiceDictInfo> findItemDict(@Param("itemType")int itemType,@Param("isValid")int isValid);
List<ServiceDictInfo> findAllItemDict(@Param("itemType")int itemType);

View File

@@ -162,5 +162,15 @@
UPDATE service_dict_info s set s.is_valid = #{isValid} where s.service_dict_id = #{serviceDictId}
</update>
<select id="findItemDict" resultMap="dictResultMap">
select
<include refid="serviceDictInfoColumns" />
from service_dict_info s where s.is_leaf = 0 and s.item_type=#{itemType} and s.is_valid=#{isValid};
</select>
<select id="findAllItemDict" resultMap="dictResultMap">
select
<include refid="serviceDictInfoColumns" />
from service_dict_info s where s.is_leaf = 0 and s.item_type=#{itemType};
</select>
</mapper>

View File

@@ -2,7 +2,9 @@ package com.nis.web.service.configuration;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.nis.domain.configuration.BaseIpCfg;
import com.nis.web.dao.configuration.IpCfgDao;
@@ -27,13 +29,19 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
public int addIpCfg(BaseIpCfg baseIpCfg){
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
if(StringUtils.isBlank(tableName))
return 0;
baseIpCfg.setTableName(tableName);
logger.info("save "+tableName);
return ipCfgDao.insert(baseIpCfg);
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.insert(baseIpCfg);
}else{
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
if(StringUtils.isBlank(tableName))
return 0;
baseIpCfg.setTableName(tableName);
logger.info("save "+tableName);
return ipCfgDao.insert(baseIpCfg);
}
}
/**
*
@@ -45,11 +53,67 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
public int updateIpCfg(BaseIpCfg baseIpCfg){
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
baseIpCfg.setTableName(tableName);
logger.info("update "+tableName);
return ipCfgDao.updateByPrimaryKeySelective(baseIpCfg);
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.updateByPrimaryKeySelective(baseIpCfg);
}else{
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
if(StringUtils.isBlank(tableName))
return 0;
baseIpCfg.setTableName(tableName);
logger.info("update "+tableName);
return ipCfgDao.updateByPrimaryKeySelective(baseIpCfg);
}
}
/**
*
* auditIpCfg(审核IP类配置)
* (继承BaseIpCfg这个类方可使用)
* @param baseIpCfg
* @return
*int
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
public int auditIpCfg(BaseIpCfg baseIpCfg){
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.audit(baseIpCfg);
}else{
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
if(StringUtils.isBlank(tableName))
return 0;
baseIpCfg.setTableName(tableName);
logger.info("aduit "+tableName);
return ipCfgDao.audit(baseIpCfg);
}
}
/**
*
* deleteIpCfg(删除IP类配置)
* (继承BaseIpCfg这个类方可使用)
* @param baseIpCfg
* @return
*int
* @exception
* @since 1.0.0
*/
@Transactional(readOnly=false,rollbackFor=DataAccessException.class)
public int deleteIpCfg(BaseIpCfg baseIpCfg){
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.updateValid(baseIpCfg);
}else{
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
if(StringUtils.isBlank(tableName))
return 0;
baseIpCfg.setTableName(tableName);
logger.info("delete "+tableName);
return ipCfgDao.updateValid(baseIpCfg);
}
}
/**
*
@@ -64,6 +128,8 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
*/
public BaseIpCfg getIpCfgById(Class<?> clazz,long id){
String tableName=getTableName(clazz.getSimpleName());
if(StringUtils.isBlank(tableName))
return null;
logger.info("get "+tableName);
return ipCfgDao.getById(tableName, id);
}
@@ -79,10 +145,46 @@ public class IpCfgService extends CrudService<IpCfgDao,BaseIpCfg> {
* @since 1.0.0
*/
public BaseIpCfg getIpCfgById(BaseIpCfg baseIpCfg){
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
baseIpCfg.setTableName(tableName);
logger.info("get "+tableName);
return ipCfgDao.get(baseIpCfg);
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.get(baseIpCfg);
}else{
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
if(StringUtils.isBlank(tableName))
return null;
baseIpCfg.setTableName(tableName);
logger.info("get "+tableName);
return ipCfgDao.get(baseIpCfg);
}
}
public Integer getIsValid(BaseIpCfg baseIpCfg){
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.getIsValid(baseIpCfg);
}else{
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
if(StringUtils.isBlank(tableName))
return null;
baseIpCfg.setTableName(tableName);
return ipCfgDao.getIsValid(baseIpCfg);
}
}
public Integer getIsValid(String tableName, long id){
return ipCfgDao.getIsValid(tableName,id);
}
public Integer getIsAudit(BaseIpCfg baseIpCfg){
if(!StringUtils.isBlank(baseIpCfg.getTableName())){
return ipCfgDao.getIsAudit(baseIpCfg);
}else{
String tableName=getTableName(baseIpCfg.getClass().getSimpleName());
if(StringUtils.isBlank(tableName))
return null;
baseIpCfg.setTableName(tableName);
return ipCfgDao.getIsAudit(baseIpCfg);
}
}
public Integer getIsAudit(String tableName, long id){
return ipCfgDao.getIsAudit(tableName,id);
}
}

View File

@@ -1,6 +1,8 @@
package com.nis.web.service.configuration;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DataAccessException;
@@ -9,6 +11,7 @@ import org.springframework.transaction.annotation.Transactional;
import com.nis.domain.Page;
import com.nis.domain.configuration.RequestInfo;
import com.nis.util.Constants;
import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.RequestInfoDao;
import com.nis.web.security.UserUtils;
@@ -69,4 +72,13 @@ public class RequestInfoService extends BaseService{
requestInfo.setIsValid(-1);
requestInfoDao.delete(requestInfo);//删除
}
public List<RequestInfo> getValidRequestInfo(){
RequestInfo requestInfo=new RequestInfo();
requestInfo.setIsValid(Constants.VALID_YES);
return requestInfoDao.findRequestInfo(requestInfo);
}
public List<RequestInfo> getAllRequestInfo(){
RequestInfo requestInfo=new RequestInfo();
return requestInfoDao.findAllList(requestInfo);
}
}

View File

@@ -8,11 +8,9 @@ import org.springframework.stereotype.Service;
import com.google.common.collect.Lists;
import com.nis.domain.Page;
import com.nis.domain.SysDataDictionaryItem;
import com.nis.domain.SysMenu;
import com.nis.domain.SysUser;
import com.nis.domain.configuration.ServiceDictInfo;
import com.nis.util.DateUtil;
import com.nis.util.Constants;
import com.nis.util.StringUtil;
import com.nis.web.dao.configuration.ServiceDictInfoDao;
import com.nis.web.security.UserUtils;
@@ -114,7 +112,78 @@ public class ServiceDictInfoService extends BaseService{
serviceDictInfo.setIsValid(0);
serviceDictInfoDao.delete(serviceDictInfo);
}
/**
*
* findFlDict(查找所有有效的分类)
* (这里描述这个方法适用条件 可选)
* @return
*List<ServiceDictInfo>
* @exception
* @since 1.0.0
*/
public List<ServiceDictInfo> findFlDict() {
return serviceDictInfoDao.findItemDict(Constants.ITEM_TYPE_FL,Constants.VALID_YES);
}
/**
*
* findFlDict(查找所有有效的分类)
* (这里描述这个方法适用条件 可选)
* @return
*List<ServiceDictInfo>
* @exception
* @since 1.0.0
*/
public List<ServiceDictInfo> findAllFlDict() {
return serviceDictInfoDao.findAllItemDict(Constants.ITEM_TYPE_FL);
}
/**
*
* findFlDict(查找所有有效的性质)
* (这里描述这个方法适用条件 可选)
* @return
*List<ServiceDictInfo>
* @exception
* @since 1.0.0
*/
public List<ServiceDictInfo> findXzDict() {
return serviceDictInfoDao.findItemDict(Constants.ITEM_TYPE_XZ,Constants.VALID_YES);
}
/**
*
* findFlDict(查找所有有效的性质)
* (这里描述这个方法适用条件 可选)
* @return
*List<ServiceDictInfo>
* @exception
* @since 1.0.0
*/
public List<ServiceDictInfo> findAllXzDict() {
return serviceDictInfoDao.findAllItemDict(Constants.ITEM_TYPE_XZ);
}
/**
*
* findFlDict(查找所有有效的标签)
* (这里描述这个方法适用条件 可选)
* @return
*List<ServiceDictInfo>
* @exception
* @since 1.0.0
*/
public List<ServiceDictInfo> findLableDict() {
return serviceDictInfoDao.findItemDict(Constants.ITEM_TYPE_LABEL,Constants.VALID_YES);
}
/**
*
* findFlDict(查找所有有效的标签)
* (这里描述这个方法适用条件 可选)
* @return
*List<ServiceDictInfo>
* @exception
* @since 1.0.0
*/
public List<ServiceDictInfo> findAllLableDict() {
return serviceDictInfoDao.findAllItemDict(Constants.ITEM_TYPE_LABEL);
}
}

View File

@@ -5,11 +5,14 @@
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">来函函号</label>
<label class="control-label col-md-3">来函</label>
<div class="col-md-8">
<select class="form-control">
<option>Country 1</option>
<option>Country 2</option>
<select name="requestId" data-live-search="true" data-live-search-placeholder="搜索" class="selectpicker form-control" title="--请选择--">
<c:forEach items="${requestInfos}" var="requestInfo">
<option value="${requestInfo.id}"
<c:if test="${requestInfo.isValid==0 or requestInfo.isAudit==3}">disabled="disabled"</c:if>
<c:if test="${requestInfo.id==_ipCfg.requestId}">selected</c:if>>${requestInfo.requestTitle}</option>
</c:forEach>
</select>
</div>
</div>
@@ -17,12 +20,16 @@
<!--/span-->
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">专项任务</label>
<label class="control-label col-md-3">分类</label>
<div class="col-md-8">
<select class="form-control">
<option>Country 1</option>
<option>Country 2</option>
</select>
<select name="classify" multiple class="selectpicker form-control" title="--请选择--">
<c:forEach items="${fls}" var="fl">
<option value="${fl.item_code}"
<c:if test="${fl.isValid==0}">disabled="disabled"</c:if>
<c:if test="${fl.item_code==_ipCfg.classify}">selected</c:if>
>${fl.item_value}</option>
</c:forEach>
</select>
</div>
</div>
</div>
@@ -32,12 +39,16 @@
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">分类性质</label>
<label class="control-label col-md-3">性质</label>
<div class="col-md-8">
<select class="form-control">
<option>Country 1</option>
<option>Country 2</option>
</select>
<select name="attribute" multiple class="selectpicker form-control" title="--请选择--">
<c:forEach items="${xzs}" var="xz">
<option value="${xz.item_code}"
<c:if test="${xz.isValid==0}">disabled="disabled"</c:if>
<c:if test="${xz.item_code==_ipCfg.attribute}">selected</c:if>
>${xz.item_value}</option>
</c:forEach>
</select>
</div>
</div>
</div>
@@ -45,10 +56,14 @@
<div class="form-group">
<label class="control-label col-md-3">标签</label>
<div class="col-md-8">
<select class="form-control">
<option>Country 1</option>
<option>Country 2</option>
</select>
<select name="lable" multiple class="selectpicker form-control" title="--请选择--">
<c:forEach items="${lables}" var="lable">
<option value="${lable.item_code}"
<c:if test="${lable.isValid==0}">disabled="disabled"</c:if>
<c:if test="${lable.item_code==_ipCfg.label}">selected</c:if>
>${lable.item_value}</option>
</c:forEach>
</select>
</div>
</div>
</div>

View File

@@ -4,21 +4,195 @@
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">IP地址</label>
<label class="control-label col-md-3">配置描述</label>
<div class="col-md-8">
<input class="form-control" type="text">
<input class="form-control" type="text" name="cfgDesc" value="${_ipCfg.cfgDesc}">
</div>
</div>
</div>
<!--/span-->
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3">配置名称</label>
<label class="control-label col-md-3">ip类型</label>
<div class="col-md-8">
<input class="form-control" type="text">
<select name="ipType" class="selectpicker show-tick form-control" title="--请选择--">
<option value="4" <c:if test="${_ipCfg.ipType==4}">selected</c:if> >V4</option>
<option value="6" <c:if test="${_ipCfg.ipType==6}">selected</c:if>>V6</option>
</select>
<!-- <input class="form-control" type="text" value="${_ipCfg.ipType}">-->
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">源IP地址</label>
<div class="col-md-8">
<input class="form-control" type="text" name="srcIp" value="${_ipCfg.srcIp}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3">源地址掩码</label>
<div class="col-md-8">
<input class="form-control" type="text" name="srcIpMask" value="${_ipCfg.srcIpMask}">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">源端口</label>
<div class="col-md-8">
<input class="form-control" type="text" name="srcPort" value="${_ipCfg.srcPort}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3">源端口掩码</label>
<div class="col-md-8">
<input class="form-control" type="text" name="srcPortMask" value="${_ipCfg.srcPortMask}">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">目的IP地址</label>
<div class="col-md-8">
<input class="form-control" type="text" name="dstIp" value="${_ipCfg.dstIp}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3">目的地址掩码</label>
<div class="col-md-8">
<input class="form-control" type="text" name="dstIpMask" value="${_ipCfg.dstIpMask}">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">目的端口</label>
<div class="col-md-8">
<input class="form-control" type="text" name="dstPort" value="${_ipCfg.dstPort}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3">目的端口掩码</label>
<div class="col-md-8">
<input class="form-control" type="text" name="dstPortMask" value="${_ipCfg.dstPortMask}">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">方向</label>
<div class="col-md-8">
<select name="direction" class="selectpicker show-tick form-control" title="--请选择--">
<option value="0" <c:if test="${_ipCfg.direction==0}">selected</c:if>>0</option>
<option value="1" <c:if test="${_ipCfg.direction==1}">selected</c:if>>1</option>
</select>
<%-- <input class="form-control" type="text" name="direction" value="${_ipCfg.direction}"> --%>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3">协议</label>
<div class="col-md-8">
<select name="protocol" class="selectpicker show-tick form-control" title="--请选择--">
<option value="6" <c:if test="${_ipCfg.protocol==6}">selected</c:if>>TCP</option>
<option value="17" <c:if test="${_ipCfg.protocol==17}">selected</c:if>>UDP</option>
<option value="0" <c:if test="${_ipCfg.protocol==0}">selected</c:if>>任意</option>
</select>
<%-- <input class="form-control" type="text" name="protocol" value="${_ipCfg.protocol}"> --%>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">协议ID</label>
<div class="col-md-8">
<input class="form-control" type="text" name="protocolId" value="${_ipCfg.protocolId}" readonly="readonly">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3">管控类型</label>
<div class="col-md-8">
<input class="form-control" type="text" name="action" value="${_ipCfg.action}" readonly="readonly">
</div>
</div>
</div>
</div>
<%-- <div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">有效标识</label>
<div class="col-md-8">
<input class="form-control" type="text" name="isValid" value="${_ipCfg.isValid}">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3">是否审核</label>
<div class="col-md-8">
<label class="radio-inline">
<input type="radio" name="isAudit" value="1"
<c:if test="${_ipCfg.isAudit==1}"></c:if>
>是
</label>
<label class="radio-inline">
<input type="radio" name="isAudit" value="0"
<c:if test="${_ipCfg.isAudit==0}"></c:if>
>否
</label>
</div>
</div>
</div>
</div> --%>
<div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">是否区域管控</label>
<div class="col-md-8">
<label class="radio-inline">
<input type="radio" name="isAreaEffective" value="1"
<c:if test="${_ipCfg.isAreaEffective==1}">checked</c:if>
>是
</label>
<label class="radio-inline">
<input type="radio" name="isAreaEffective" value="0"
<c:if test="${_ipCfg.isAreaEffective==0}">checked</c:if>
>否
</label>
<%-- <input class="form-control" type="text" name="isAreaEffective" value="${_ipCfg.isAreaEffective}"> --%>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3">区域生效id</label>
<div class="col-md-8">
<input class="form-control" type="text" name="areaEffectiveIds" value="${_ipCfg.areaEffectiveIds}">
</div>
</div>
</div>
<!--/span-->
</div>
<!--/row-->

View File

@@ -0,0 +1,125 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title><spring:message code="${cfgName}"></spring:message></title>
<link href="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/css/bootstrap-select.min.css" rel="stylesheet"/>
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/bootstrap-select.min.js"></script>
<script type="text/javascript">
$(function(){
$("#save").on("click",function(){
$("#ipCfgFrom").attr("action","${ctx}/cfg/ip/saveOrUpdateIpCfg");
$("#save").submit();
});
$("select[name='ipType']").on("change",function(){
var type=$(this).val();
if(4==type){
if(!$("input[name='srcIpMask']").val()){
$("input[name='srcIpMask']").val("255.255.255.255");
}else if($("input[name='srcIpMask']").val()=="FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"){
$("input[name='srcIpMask']").val("255.255.255.255");
}
if(!$("input[name='dstIpMask']").val()){
$("input[name='dstIpMask']").val("255.255.255.255");
}else if($("input[name='dstIpMask']").val()=="FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF"){
$("input[name='dstIpMask']").val("255.255.255.255");
}
}
if(6==type){
if(!$("input[name='srcIpMask']").val()){
$("input[name='srcIpMask']").val("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
}else if($("input[name='srcIpMask']").val()=="255.255.255.255"){
$("input[name='srcIpMask']").val("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
}
if(!$("input[name='dstIpMask']").val()){
$("input[name='dstIpMask']").val("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
}else if($("input[name='dstIpMask']").val()=="255.255.255.255"){
$("input[name='dstIpMask']").val("FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF");
}
}
});
});
</script>
</head>
<body>
<div class="page-content">
<h3 class="page-title">
<spring:message code="${cfgName}"></spring:message>
<c:if test="${empty _ipCfg.cfgId}">新增</c:if>
<c:if test="${not empty _ipCfg.cfgId}">修改</c:if>
</h3>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-gift"></i><spring:message code="${cfgName}"></spring:message>
<c:if test="${empty _ipCfg.cfgId}">新增</c:if>
<c:if test="${not empty _ipCfg.cfgId}">修改</c:if>
</div>
<!-- <div class="tools">
<a href="javascript:;" class="collapse" data-original-title="" title=""> </a>
<a href="#portlet-config" data-toggle="modal" class="config" data-original-title="" title=""> </a>
<a href="javascript:;" class="reload" data-original-title="" title=""> </a>
<a href="javascript:;" class="remove" data-original-title="" title=""> </a>
</div> -->
</div>
<div class="portlet-body form">
<!-- BEGIN FORM-->
<form id="ipCfgFrom" action="#" method="post" class="form-horizontal">
<div class="form-body">
<%@include file="/WEB-INF/include/form/ipInfo.jsp" %>
<c:if test="${not empty _ipCfg.cfgId}">
<input type="hidden" name="cfgId" value="${_ipCfg.cfgId}">
</c:if>
<input type="hidden" name="tableName" value="${_ipCfg.tableName}">
<input type="hidden" name="serviceId" value="${_ipCfg.serviceId}">
<input type="hidden" name="cfgName" value="${cfgName}">
<!-- <div class="row">
<div class="col-md-6">
<div class="form-group">
<label class="control-label col-md-3">IP地址</label>
<div class="col-md-8">
<input class="form-control" type="text">
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group ">
<label class="control-label col-md-3">配置名称</label>
<div class="col-md-8">
<input class="form-control" type="text">
</div>
</div>
</div>
</div>
-->
<%@include file="/WEB-INF/include/form/basicInfo.jsp" %>
</div>
<div class="form-actions">
<div class="row">
<div class="col-md-6">
<div class="row">
<div class="col-md-offset-3 col-md-8">
<button id="save" type="submit" class="btn green">保存</button>
<button type="button" class="btn default">Cancel</button>
</div>
</div>
</div>
<div class="col-md-6"> </div>
</div>
</div>
</form>
<!-- END FORM-->
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,232 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title><spring:message code="${cfgName}"></spring:message></title>
<link href="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/css/bootstrap-select.min.css" rel="stylesheet"/>
<script src="${pageContext.request.contextPath}/static/global/plugins/bootstrap-select/js/bootstrap-select.min.js"></script>
<script>
$(document).ready(function() {
});
//查询
function page(n,s){
$("#pageNo").val(n);
$("#pageSize").val(s);
$("#searchForm").submit();
return false;
}
</script>
</head>
<body>
<div class="page-content">
<div class="theme-panel hidden-xs hidden-sm">
<button type="button" class="btn btn-default" onclick="location='${ctx}/cfg/ip/ipCfgList?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}'"><spring:message code="refresh"></spring:message></button>
<button type="button" class="btn btn-primary"
onClick="javascript:window.location='${ctx}/cfg/ip/ipCfgForm?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}'">新增<spring:message code="${cfgName}"></spring:message></button>
</div>
<h3 class="page-title">
<spring:message code="${cfgName}"></spring:message>详情
</h3>
<div class="row">
<div class="col-md-12">
<div class="portlet box blue">
<div class="portlet-title">
<div class="caption">
<i class="fa fa-cogs"></i><spring:message code="${cfgName}"></spring:message>详情
</div>
<div class="tools">
<!-- <a href="javascript:;" class="collapse" data-original-title=""
title=""> </a> <a href="#portlet-config" data-toggle="modal"
class="config" data-original-title="" title=""> </a> <a
href="javascript:;" class="reload" data-original-title=""
title=""> </a> <a href="javascript:;" class="remove"
data-original-title="" title=""> </a> -->
</div>
</div>
<div class="portlet-body">
<div class="row" >
<form:form id="searchForm" modelAttribute="ipCfg" action="${ctx}/cfg/ip/ipCfgList?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}" method="post" class="form-search">
<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<div class="col-md-12">
<spring:message code="state"/> : <form:select path="isAudit" class="selectpicker select2" title="--请选择--" data-live-search="true" data-live-search-placeholder="搜索">
<form:option value=""></form:option>
<form:option value="0"><spring:message code="created"></spring:message></form:option>
<form:option value="1"><spring:message code="approved"></spring:message></form:option>
<form:option value="2"><spring:message code="unapproved"></spring:message></form:option>
<form:option value="3"><spring:message code="取消审核通过"></spring:message></form:option>
</form:select>
<spring:message code="函号"/> :
<select name="requestId" class="selectpicker select2" title="--请选择--">
<option value=""></option>
<c:forEach items="${requestInfos}" var="requestInfo" >
<option value="${requestInfo.id}">${requestInfo.requestTitle}</option>
</c:forEach>
</select>
<button type="button" class="btn btn-default btn-sm" onclick="return page()">
<i class="fa fa-edit"></i><spring:message code="search"></spring:message>
</button>
&nbsp;&nbsp; 排序: <select name="page.orderBy">
<option></option>
<option value="createTime asc">按创建时间顺序</option>
<option value="createTime desc">按创建时间倒序</option>
<option value="editTime asc">按修改时间顺序</option>
<option value="editTime desc">按修改时间倒序</option>
<option value="auditTime asc">按审核时间顺序</option>
<option value="auditTime desc">按审核时间倒序</option>
</select>
</div>
</form:form>
</div>
<div class="table-responsive">
<table class="table table-bordered text-nowrap">
<thead>
<tr>
<th>配置ID</th>
<th>配置描述</th>
<th>ip类型</th>
<th>源IP地址</th>
<th>源地址掩码</th>
<th>源端口</th>
<th>源端口掩码</th>
<th>目的IP地址</th>
<th>目的地址掩码</th>
<th>目的端口</th>
<th>目的端口掩码</th>
<th>方向</th>
<th>协议</th>
<th>协议ID</th>
<th>管控类型</th>
<th>有效标识</th>
<th>是否审核</th>
<th>创建人员</th>
<th>配置时间</th>
<th>修改人员</th>
<th>修改时间</th>
<th>审核人员</th>
<th>审核时间</th>
<th>业务id</th>
<th>来函</th>
<th>编译id</th>
<th>是否区域管控</th>
<th>分类</th>
<th>性质</th>
<th>标签</th>
<th>区域生效id</th>
<th><spring:message code="operation"></spring:message></th>
</tr>
</thead>
<tbody>
<c:forEach items="${page.list }" var="ipCfg">
<tr>
<td>${ipCfg.cfgId }</td>
<td>${ipCfg.cfgDesc }</td>
<td>V${ipCfg.ipType }</td>
<td>${ipCfg.srcIp }</td>
<td>${ipCfg.srcIpMask }</td>
<td>${ipCfg.srcPort }</td>
<td>${ipCfg.srcPortMask }</td>
<td>${ipCfg.dstIp }</td>
<td>${ipCfg.dstIpMask }</td>
<td>${ipCfg.dstPort }</td>
<td>${ipCfg.dstPortMask }</td>
<td>${ipCfg.direction }</td>
<td>${ipCfg.protocol }</td>
<td>${ipCfg.protocolId }</td>
<td>
<c:if test="${1 eq ipCfg.action }">阻断</c:if>
<c:if test="${2 eq ipCfg.action }">监测</c:if>
<c:if test="${5 eq ipCfg.action }">封堵白名单</c:if>
<c:if test="${6 eq ipCfg.action }">监测白名单</c:if>
<c:if test="${7 eq ipCfg.action }">封堵监测白名单</c:if>
<c:if test="${8 eq ipCfg.action }">灰名单</c:if>
</td>
<td>
<c:if test="${ipCfg.isValid==0}">否</c:if>
<c:if test="${ipCfg.isValid==1}">是</c:if>
<c:if test="${ipCfg.isValid==-1}">已删除</c:if>
</td>
<td>
<c:choose>
<c:when test="${ipCfg.isAudit eq '0'}"><span class="label label-danger"><spring:message code="created"></spring:message></span></c:when>
<c:when test="${ipCfg.isAudit eq '1'}"><span class="label label-success"><spring:message code="approved"></spring:message></span></c:when>
<c:when test="${ipCfg.isAudit eq '2'}"><span class="label label-warning"><spring:message code="unapproved"></spring:message></span></c:when>
<c:when test="${ipCfg.isAudit eq '3'}"><span class="label label-warning"><spring:message code="取消审核通过"></spring:message></span></c:when>
</c:choose>
</td>
<td>${ipCfg.creatorName }</td>
<td><fmt:formatDate value="${ipCfg.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${ipCfg.editorName }</td>
<td><fmt:formatDate value="${ipCfg.editTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${ipCfg.auditorName }</td>
<td><fmt:formatDate value="${ipCfg.auditTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td>${ipCfg.serviceId }</td>
<td>${ipCfg.requestName }</td>
<td>${ipCfg.compileId }</td>
<td>
<c:if test="${ipCfg.isAreaEffective==0}">否</c:if>
<c:if test="${ipCfg.isAreaEffective==1}">是</c:if>
</td>
<td>${ipCfg.classifyName }</td>
<td>${ipCfg.attributeName }</td>
<td>${ipCfg.lableName }</td>
<td>${ipCfg.areaEffectiveIds }</td>
<td>
<div class="btn-group btn-xs">
<a class="btn btn-primary btn-xs dropdown-toggle" data-toggle="dropdown" href="#"><spring:message code="operation"></spring:message><span class="caret"></span></a>
<ul class="dropdown-menu btn-xs">
<!-- 审核未通过可修改 -->
<c:choose>
<c:when test="${ipCfg.isAudit eq '1'}">
<li><a href="${ctx}/cfg/ip/auditIpCfg?serviceId=${ipCfg.serviceId}&action=${ipCfg.action}&tableName=${ipCfg.tableName}&cfgId=${ipCfg.cfgId}&isAudit=3&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="cancel"></spring:message></a></li>
</c:when>
<c:when test="${ipCfg.isAudit eq '0'}">
<li><a href="${ctx}/cfg/ip/auditIpCfg?serviceId=${ipCfg.serviceId}&action=${ipCfg.action}&tableName=${ipCfg.tableName}&cfgId=${ipCfg.cfgId}&isAudit=2&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="unapproved"></spring:message></a></li>
<li><a href="${ctx}/cfg/ip/auditIpCfg?serviceId=${ipCfg.serviceId}&action=${ipCfg.action}&tableName=${ipCfg.tableName}&cfgId=${ipCfg.cfgId}&isAudit=1&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="approved"></spring:message></a></li>
<li><a href="${ctx}/cfg/ip/deleteIpCfg?serviceId=${ipCfg.serviceId}&action=${ipCfg.action}&tableName=${ipCfg.tableName}&cfgId=${ipCfg.cfgId}&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="delete"></spring:message></a></li>
</c:when>
<c:when test="${ipCfg.isAudit eq '2'}">
<li><a href="${ctx}/cfg/ip/updateIpCfgForm?serviceId=${ipCfg.serviceId}&action=${ipCfg.action}&tableName=${ipCfg.tableName}&cfgId=${ipCfg.cfgId}&cfgName=${cfgName}" onclick="javascript:return confirm('sure', this.href)"><spring:message code="修改配置"></spring:message></a></li>
<li><a href="${ctx}/cfg/ip/auditIpCfg?serviceId=${ipCfg.serviceId}&action=${ipCfg.action}&tableName=${ipCfg.tableName}&cfgId=${ipCfg.cfgId}&isAudit=1&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="approved"></spring:message></a></li>
<li><a href="${ctx}/cfg/ip/deleteIpCfg?serviceId=${ipCfg.serviceId}&action=${ipCfg.action}&tableName=${ipCfg.tableName}&cfgId=${ipCfg.cfgId}&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="delete"></spring:message></a></li>
</c:when>
<c:otherwise>
<li><a href="${ctx}/cfg/ip/auditIpCfg?serviceId=${ipCfg.serviceId}&action=${ipCfg.action}&tableName=${ipCfg.tableName}&cfgId=${ipCfg.cfgId}&isAudit=1&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="approved"></spring:message></a></li>
<li><a href="${ctx}/cfg/ip/deleteIpCfg?serviceId=${ipCfg.serviceId}&action=${ipCfg.action}&tableName=${ipCfg.tableName}&cfgId=${ipCfg.cfgId}&cfgName=${cfgName}" onclick="return confirm('sure', this.href)"><spring:message code="delete"></spring:message></a></li>
</c:otherwise>
</c:choose>
</ul>
</div>
</td>
</tr>
</c:forEach>
</tbody>
</table>
<div class="page">${page}</div>
</div>
</div>
</div>
</div>
<style>
.input-medium {
width: 200px !important;
}
.Wdate {
border: #c2cad8 1px solid;
height: 26px;
}
.dropdown-menu {
min-width: 50px;
}
</style>
</body>
</html>

View File

@@ -0,0 +1,17 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title>结果跳转页</title>
<script type="text/javascript">
$(document).ready(function() {
setTimeout("javascript:window.location.href='${ctx}/cfg/ip/ipCfgList?serviceId=${serviceId}&action=${action}&cfgName=${cfgName}'",5000);
});
</script>
</head>
<body>
<div class="page-content">
${message}
</div>
</body>
</html>